Skip to content

Conversation

@kubkon
Copy link
Member

@kubkon kubkon commented Oct 7, 2025

A couple of caveats:

  • We should not auto-escape arguments with Alacritty's escape_args option if using CMD otherwise, the generated command will have way too many escaped characters for CMD to parse correctly.
  • When composing a full command for CMD, we need to put it in double quotes manually: cmd /C "activate.bat& pwsh.exe -C do_something" so that CMD executes the entire string as a sequence of commands.
  • CMD requires & as a chaining operator for commands (; for other shells).

Release Notes:

  • N/A

A couple of caveats:
- We should not auto-escape arguments with Alacritty's `escape_args` option if using CMD
  otherwise, the generated command will have way too many escaped characters for CMD to parse correctly.
- When composing a full command for CMD, we need to put it in double quotes manually:
  `cmd /C "activate.bat& pwsh.exe -C do_something"` so that CMD executes the entire string
  as a sequence of commands.
- CMD requires `&` as a chaining operator for commands (`;` for other shells).
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 7, 2025
@kubkon kubkon requested a review from Veykril October 8, 2025 08:28
Comment on lines +211 to +213
// We need to put the entire command in quotes since otherwise CMD tries to execute them
// as separate commands rather than chaining one after another.
arg = format!("\"{arg}\"");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShellBuilder itself is probably prone to doing this incorrectly as well then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a good catch - confirmed that ' does not work with CMD. I tweaked ShellBuilder to also use double quotes.

@kubkon kubkon enabled auto-merge (squash) October 8, 2025 15:57
@kubkon kubkon merged commit 4684d6b into main Oct 8, 2025
23 checks passed
@kubkon kubkon deleted the windows/python-tests-cmd-2 branch October 8, 2025 16:44
JosephTLyons pushed a commit that referenced this pull request Oct 8, 2025
A couple of caveats:
- We should not auto-escape arguments with Alacritty's `escape_args`
option if using CMD otherwise, the generated command will have way too
many escaped characters for CMD to parse correctly.
- When composing a full command for CMD, we need to put it in double
quotes manually: `cmd /C "activate.bat& pwsh.exe -C do_something"` so
that CMD executes the entire string as a sequence of commands.
- CMD requires `&` as a chaining operator for commands (`;` for other
shells).

Release Notes:

- N/A
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Oct 11, 2025
…ustries#39701)

A couple of caveats:
- We should not auto-escape arguments with Alacritty's `escape_args`
option if using CMD otherwise, the generated command will have way too
many escaped characters for CMD to parse correctly.
- When composing a full command for CMD, we need to put it in double
quotes manually: `cmd /C "activate.bat& pwsh.exe -C do_something"` so
that CMD executes the entire string as a sequence of commands.
- CMD requires `&` as a chaining operator for commands (`;` for other
shells).

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants