File tree Expand file tree Collapse file tree 5 files changed +24
-7
lines changed Expand file tree Collapse file tree 5 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ All changes included in 1.8:
79
79
80
80
- ([ #12627 ] ( https://github.com/quarto-dev/quarto-cli/issues/12627 ) ): Don't actually install extension when user responds ` yes ` to first prompt but ` no ` to second.
81
81
82
+ ### ` create `
83
+
84
+ - ([ #12965 ] ( https://github.com/quarto-dev/quarto-cli/issues/12965 ) ): Prevent automatic opening of new editor sessions when creating projects in Posit Workbench context. The ` --open ` flag is now ignored in this environment to avoid issues with Workbench session management.
85
+
82
86
## Engines
83
87
84
88
### ` jupyter `
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ import { extensionArtifactCreator } from "./artifacts/extension.ts";
8
8
import { projectArtifactCreator } from "./artifacts/project.ts" ;
9
9
import { kEditorInfos , scanForEditors } from "./editor.ts" ;
10
10
11
- import { isInteractiveTerminal } from "../../core/platform.ts" ;
11
+ import {
12
+ isInteractiveTerminal ,
13
+ isPositWorkbench ,
14
+ } from "../../core/platform.ts" ;
12
15
import { runningInCI } from "../../core/ci-info.ts" ;
13
16
14
17
import { Command } from "cliffy/command/mod.ts" ;
@@ -56,6 +59,16 @@ export const createCommand = new Command()
56
59
const isInteractive = isInteractiveTerminal ( ) && ! runningInCI ( ) ;
57
60
const allowPrompt = isInteractive && ! ! options . prompt && ! options . json ;
58
61
62
+ // Specific case where opening automatically in an editor is not allowed
63
+ if ( options . open !== false && isPositWorkbench ( ) ) {
64
+ if ( options . open !== undefined ) {
65
+ info (
66
+ `The --open option is not supported in Posit Workbench - ignoring` ,
67
+ ) ;
68
+ }
69
+ options . open = false ;
70
+ }
71
+
59
72
// Resolve the type into an artifact
60
73
const resolved = await resolveArtifact (
61
74
type ,
Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ import {
76
76
safeExistsSync ,
77
77
} from "../../core/path.ts" ;
78
78
import {
79
+ isPositWorkbench ,
79
80
isRStudio ,
80
- isRStudioWorkbench ,
81
81
isServerSession ,
82
82
isVSCodeServer ,
83
83
vsCodeServerProxyUri ,
@@ -872,7 +872,7 @@ function pdfFileRequestHandler(
872
872
const onRequest = pdfOptions . onRequest ;
873
873
pdfOptions . onRequest = async ( req : Request ) => {
874
874
if ( new URL ( req . url ) . pathname === "/" ) {
875
- const url = isRStudioWorkbench ( )
875
+ const url = isPositWorkbench ( )
876
876
? await rswURL ( port , kPdfJsInitialPath )
877
877
: isVSCodeServer ( )
878
878
? vsCodeServerProxyUri ( ) ! . replace ( "{{port}}" , `${ port } ` ) +
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export function isVSCodeServer() {
34
34
return ! ! vsCodeServerProxyUri ( ) ;
35
35
}
36
36
37
- export function isRStudioWorkbench ( ) {
37
+ export function isPositWorkbench ( ) {
38
38
// RS_SERVER_URL e.g. https://daily-rsw.soleng.rstudioservices.com/
39
39
// RS_SESSION_URL e.g. /s/eae053c9ab5a71168ee19/
40
40
return ! ! Deno . env . get ( "RS_SERVER_URL" ) && ! ! Deno . env . get ( "RS_SESSION_URL" ) ;
@@ -50,7 +50,7 @@ export function isPositronTerminal() {
50
50
}
51
51
52
52
export function isServerSession ( ) {
53
- return isRStudioServer ( ) || isRStudioWorkbench ( ) || isJupyterServer ( ) ||
53
+ return isRStudioServer ( ) || isPositWorkbench ( ) || isJupyterServer ( ) ||
54
54
isJupyterHubServer ( ) || isVSCodeServer ( ) ;
55
55
}
56
56
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ import * as colors from "fmt/colors";
10
10
import {
11
11
isJupyterHubServer ,
12
12
isJupyterServer ,
13
+ isPositWorkbench ,
13
14
isRStudioServer ,
14
- isRStudioWorkbench ,
15
15
isVSCodeServer ,
16
16
isVSCodeTerminal ,
17
17
jupyterHubHttpReferrer ,
@@ -58,7 +58,7 @@ export async function printBrowsePreviewMessage(
58
58
path : string ,
59
59
) {
60
60
if (
61
- ( isJupyterServer ( ) || isVSCodeTerminal ( ) ) && isRStudioWorkbench ( )
61
+ ( isJupyterServer ( ) || isVSCodeTerminal ( ) ) && isPositWorkbench ( )
62
62
) {
63
63
const url = await rswURL ( port , path ) ;
64
64
info ( `\nPreview server: ${ previewURL ( host , port , path = "" ) } ` ) ;
You can’t perform that action at this time.
0 commit comments