@@ -33,21 +33,23 @@ function applySidebarContext(): void {
3333async function openSplitTerminal ( ) : Promise < void > {
3434 const startupCommand = getConfig < string > ( 'startupCommand' , 'snow' ) ;
3535
36- // 1. Split the editor area to the right
37- await vscode . commands . executeCommand ( 'workbench.action.splitEditorRight' ) ;
36+ const workspaceFolder = vscode . workspace . workspaceFolders ?. [ 0 ] ?. uri . fsPath ;
3837
39- const workspaceFolder =
40- vscode . workspace . workspaceFolders ?. [ 0 ] ?. uri . fsPath ;
41-
42- // 2. Create a new terminal in the editor area (each call creates a new instance)
38+ // 1. Create a new terminal in the editor area (initially in current column)
4339 const terminal = vscode . window . createTerminal ( {
4440 name : 'Snow CLI' ,
4541 cwd : workspaceFolder ,
4642 location : vscode . TerminalLocation . Editor ,
4743 } ) ;
4844
45+ // 2. Show the terminal first
4946 terminal . show ( ) ;
5047
48+ // 3. Move the terminal to the right group (creates right split if needed)
49+ await vscode . commands . executeCommand (
50+ 'workbench.action.moveEditorToRightGroup' ,
51+ ) ;
52+
5153 if ( startupCommand ) {
5254 terminal . sendText ( startupCommand ) ;
5355 }
@@ -127,14 +129,16 @@ export function activate(context: vscode.ExtensionContext) {
127129 vscode . workspace . onDidChangeConfiguration ( e => {
128130 if ( e . affectsConfiguration ( 'snow-cli.terminalMode' ) ) {
129131 applySidebarContext ( ) ;
130- vscode . window . showInformationMessage (
131- 'Snow CLI: Terminal mode changed. Please reload the window for full effect.' ,
132- 'Reload' ,
133- ) . then ( choice => {
134- if ( choice === 'Reload' ) {
135- vscode . commands . executeCommand ( 'workbench.action.reloadWindow' ) ;
136- }
137- } ) ;
132+ vscode . window
133+ . showInformationMessage (
134+ 'Snow CLI: Terminal mode changed. Please reload the window for full effect.' ,
135+ 'Reload' ,
136+ )
137+ . then ( choice => {
138+ if ( choice === 'Reload' ) {
139+ vscode . commands . executeCommand ( 'workbench.action.reloadWindow' ) ;
140+ }
141+ } ) ;
138142 }
139143
140144 if ( e . affectsConfiguration ( 'snow-cli.startupCommand' ) ) {
0 commit comments