Agent Mode Fails to Execute Multiple Terminal Commands on Windows due to Incorrect && Command Separator

When the agent attempts to execute multiple terminal commands in Agent Mode on a Windows operating system, it incorrectly uses the && operator to string them together into a single command.

This operator (&&) is the standard command separator in Unix-like shells (like Bash or Zsh) but is not supported in the default Windows Command Prompt (cmd.exe) or PowerShell.

Observed Behavior (The Bug)

  1. The agent constructs a single command string using command1 && command2 && command3.

  2. The Windows shell (e.g., cmd.exe) rejects this composite command, likely returning an error for the first &&.

  3. As a fallback, the agent then attempts to execute each command separately (e.g., command1, then command2, then command3).

  4. This incorrect initial attempt and subsequent fallback happen every time multiple commands are run, effectively doubling or tripling the execution time and significantly impacting the agent’s efficiency and overall execution time.

Expected Behavior

When running on a Windows environment, the agent should use the appropriate Windows command separator to execute multiple commands sequentially, such as:

  • Semicolon (;) for PowerShell.

  • Ampersand (&) for cmd.exe.

Ideally, the agent’s command execution logic should detect the host operating system (Windows) and use the correct separator (& for cmd.exe) for sequential command execution on the first attempt.

Current Qoder Version (0.2.6)

Open the Command Palette using the shortcut ⇧⌘P (macOS) or Ctrl+Shift+P (Windows), or go to View > Command Palette.

  1. Type “Terminal: Select Default Profile” and select it.

  2. Choose “Git Bash” as the default terminal.

  3. Restart Qoder.