VS Code: New session ignores claudeCode.useTerminal and always opens the native UI
Describe the bug
The claudeCode.useTerminal setting ("Launch Claude in the terminal instead of the native UI") is not honored by the New session entry point. The claude-vscode.newConversation command handler (the command bound to the "New session" button in the Claude Code sidebar) unconditionally takes the native-UI path — it calls notifyCreateNewConversation(), which sends create_new_conversation to the webview — so with useTerminal: true, clicking "New session" still launches the native UI instead of a terminal session.
The same inconsistency exists in the webview open_in_editor request handler, which unconditionally executes claude-vscode.editor.open.
Steps to reproduce
- Set
"claudeCode.useTerminal": truein VS Code settings. - Click New session in the Claude Code sidebar (i.e. run
claude-vscode.newConversation). - A native UI tab opens instead of a terminal session.
Expected behavior
With useTerminal enabled, claude-vscode.newConversation should open a terminal session via the already-existing claude-vscode.terminal.open command.
Suggested fix
Everything needed already ships — the claudeCode.useTerminal setting and the claude-vscode.terminal.open command (registered with a signature that accepts a session id). The fix is to wire the setting into the two handlers:
// "claude-vscode.newConversation" command handler
vscode.commands.registerCommand("claude-vscode.newConversation", async () => {
if (vscode.workspace.getConfiguration("claudeCode").get("useTerminal")) {
await vscode.commands.executeCommand("claude-vscode.terminal.open");
} else {
sessionManager.notifyCreateNewConversation();
}
});
// webview "open_in_editor" request handler
if (vscode.workspace.getConfiguration("claudeCode").get("useTerminal")) {
await vscode.commands.executeCommand("claude-vscode.terminal.open", request.sessionId);
} else {
await vscode.commands.executeCommand(
"claude-vscode.editor.open",
request.sessionId,
undefined,
vscode.ViewColumn.Active
);
}
return { type: "open_in_editor_response" };
I verified this against the shipped 2.1.251 bundle: the newConversation handler only calls notifyCreateNewConversation(), and claude-vscode.terminal.open accepts a session id. Applying the conditional above locally makes "New session" open the terminal as expected.
Environment
- Claude Code for VS Code: 2.1.251 (win32-x64)
- OS: Windows 11