Skip to content

Interactive Rebase fails to start when using xonsh shell due to command quoting #2052

@Eisfunke

Description

@Eisfunke
  • GitLens Version: v12.1.1
  • Git Version: 2.36.1
  • VSCode Version: Codium 1.68.1
  • OS Version: Arch Linux

Steps to Reproduce:

  1. Use the xonsh shell.
  2. Start an interactive rebase
  3. GitLens will then call this in the integrated shell: git -c sequence.editor="codium --wait --reuse-window" rebase --interactive COMMITHASH
  4. It fails with the following error message:
hint: Waiting for your editor to close the file... "codium --wait --reuse-window": line 1: codium --wait --reuse-window: command not found
error: There was a problem with the editor '"codium --wait --reuse-window"'.

As far as I understand, this is due to xonsh not removing quotes inside arguments, so git will actually receive 'sequence.editor="codium --wait --reuse-window"' as argument. It will therefore try to call a binary file named "codium --wait --reuse-window", which fails for obvious reasons.

bash on the other hand removes quotes inside arguments and calls git with 'sequence.editor=codium --wait --reuse-window' as argument, which works fine.

See my previous issue over at xonsh and the xonsh manual.

The fix would be easy: Just change the quotes in Line 99 in rebase.ts to cover the entire argument, like this: configs = ['-c', `"sequence.editor=${editor}"`];. This would still work in shells like sh and bash, but also in xonsh, and I'd argue that it's more correct anyway.

I understand you can't prioritize compatability with uncommon shells, but as the fix is easy and shouldn't have any downsides, I hope you'll consider it. I can make a corresponding PR if you wish, of course.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions