Skip to content

Commit aec5418

Browse files
committed
fix(extension): Fix issues with terminal splitting and configuration change prompt display
1 parent 449e0f3 commit aec5418

2 files changed

Lines changed: 19 additions & 15 deletions

File tree

VSIX/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "snow-cli",
33
"displayName": "Snow CLI",
44
"description": "Snow AI CLI with ACE Code Search - Intelligent code navigation and search powered by AI",
5-
"version": "0.4.1",
5+
"version": "0.4.2",
66
"publisher": "mufasa",
77
"repository": {
88
"type": "git",

VSIX/src/extension.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,23 @@ function applySidebarContext(): void {
3333
async 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

Comments
 (0)