Skip to content

[Feature Request] Allow users to select and configure the execution shell for the inline terminal #779

Description

@Yasai-Douhu

Overview

In Windows environments, Zoo Code's inline terminal execution feature consistently runs commands using cmd.exe, regardless of the user's VSCode terminal settings. While this issue has been reported in multiple existing threads, I would like to propose a fundamental solution: implementing a feature that allows users to explicitly select and configure the shell used in the inline terminal via a dropdown menu.

Environment

  • OS: Windows 11
  • VSCode Version: Latest
  • Zoo Code Version: Verified on latest
  • Default Terminal: PowerShell
  • LLM: Qwen_Qwen3.6-35B-A3B-Q6_K_L

Steps to Reproduce

  1. Ask the AI in the Zoo Code chat to execute a PowerShell-specific command (e.g., Get-Location).
  2. The following error occurs: 'Get-Location' is not recognized as an internal or external command, operable program or batch file.

Expected Behavior

  • The inline terminal should execute commands using the appropriate shell based on the user's VSCode terminal settings (PowerShell, cmd.exe, bash, etc.).
  • Alternatively, the user should be able to explicitly select the execution shell from a dropdown menu.

Actual Behavior

  1. The inline terminal strictly uses cmd.exe to execute commands.
  2. PowerShell-specific commands fail with a "not recognized" error.

Root Cause Analysis

This behavior originates from the following line in Zoo Code's ExecaTerminalProcess.ts:

shell: BaseTerminal.getExecaShellPath() || true, // true → cmd.exe on Windows

When getExecaShellPath() returns undefined, the fallback shell: true dictates the use of cmd.exe on Windows environments.

Proposed Solution

1. Shell Selection via Dropdown UI

Introduce a setting in the VSCode UI that allows users to select their preferred inline terminal shell from a dropdown menu.

Proposed UI:

Zoo Code > Terminal: Inline Shell
[PowerShell ▼]
  - PowerShell 5.1 (powershell.exe)
  - PowerShell 7 (pwsh.exe)
  - Command Prompt (cmd.exe)
  - Git Bash (bash.exe)
  - Custom Path...

2. New Configuration Options

Add the following properties to settings.json:

{
  "zoo-code.inlineTerminalShell": "powershell",
  "zoo-code.inlineTerminalShellPath": ""
}
  • zoo-code.inlineTerminalShell: A preset selected from the dropdown.
  • zoo-code.inlineTerminalShellPath: An absolute path for a custom shell.

3. Improved Shell Detection

Automatically detect available shells from VSCode's native terminal.integrated.profiles.windows setting and populate them in the dropdown menu.

References

Expected Impact

  • Windows users will be able to execute PowerShell-specific commands without arbitrary errors.
  • Allows for flexible command execution that respects the user's native terminal configurations.
  • Provides a universally comfortable development environment across both Unix/Linux and Windows platforms.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions