cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAS : "code: not found"

yannmiquel
Participant
901

Hi,

BAS doesn't support "git rebase -i" since it prompts

hint: Waiting for your editor to close the file... code --wait: 1: code: not found
error: There was a problem with the editor 'code --wait'.

The command code --version prompts

bash: code: command not found

What can I do in order to get a proper editor ? (either vi or vim or whatever works)

I tried the classic

git config --global core.editor 'vim' 

but it still rely on "code"

Regards,

Yann

Accepted Solutions (0)

Answers (3)

Answers (3)

T-B
Associate
Associate

Hi @yannmiquel,

Edit: The original answer seems to have only worked temporarily for some reason. What works for the duration of the terminal session at least seems to be running "export GIT_EDITOR=vim" to bring up vim for editing commit messages.

---

Original answer:

What worked for me was to disable VS Code as terminal git editor. Git then just warns me about merge conflicts and asks to resolve them manually, which is fine for me because I'll do that in VS Code / BAS Source Control view anyway.

Warning: I was not able to make VS Code / BAS open any editor though, even after re-enabling that setting.

In BAS:

  • open settings (e.g. via "Preferences: Open Settings (UI)")
  • search for setting "Terminal Git Editor" (setting id "git.terminalGitEditor")
  • disable that setting
  • restart / open new terminal

On merge conflicts git now only shows this message:

 

 

Auto-merging test.txt
CONFLICT (content): Merge conflict in test.txt
Automatic merge failed; fix conflicts and then commit the result.

 

 

Kind regards,
Tobias

 

Floatjitsu
Explorer
export GIT_EDITOR=vim worked for me, althoug I am using nano. So I used export GIT_EDITOR=nano. After that, the command git rebase -i HEAD~n worked and opened nano.
yannmiquel
Participant
0 Kudos

Still not resolved

yannmiquel
Participant
0 Kudos

Still not resolved 😞

Ask a Question