gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

Git editor is always set to pycharm, even when running through vscode

Open HughMacdonald opened this issue 2 years ago • 5 comments

Bug description

In trying to do a "git rebase -i", it said that it was waiting for the editor to close, but never gave me an editor.

Steps to reproduce

While using VSCode in GitPod, run any git command that requires an editor (git rebase -i main), and it will not show anything

Workspace affected

No response

Expected behavior

It should open some kind of editor (vim, nano, in VSCode) to allow you to edit the commit message/rebase/etc

Example repository

No response

Anything else?

I tried setting core.editor to a few different things (nano, "code --wait"), and nothing worked. I did figure out that the VSCode executable was called "gitpod-code", so set it to "gitpod-code --wait", but still no luck.

I eventually realised that $GIT_EDITOR was set to /ide-desktop/pycharm/bin/idea-cli open --wait Running unset GIT_EDITOR meant that it use the config value properly.

I would suggest, as a fix, ensuring that $GIT_EDITOR is properly set to use the same IDE that the user is using

HughMacdonald avatar Sep 25 '23 09:09 HughMacdonald

Hey @HughMacdonald 👋 , did you start your workspace with PyCharm?

mustard-mh avatar Sep 25 '23 11:09 mustard-mh

I was actually helping out @mkmacd with his workspace, so he'd be better able to answer that question

HughMacdonald avatar Sep 25 '23 11:09 HughMacdonald

I think I might have done originally but never used pycharm with it and have since changed my preference to use VS Code (which for some reason it still tries to default opening with pycharm. Not sure if there's a preference somewhere withing GitPod because the dashboard doesn't fix it.

image

mkmacd avatar Sep 25 '23 11:09 mkmacd

@mkmacd I see, your Editor of workspaces could be affected by Autostart option, you can try to reset it on your preferences page, see images below 👇

And if it's not your case, could you share your workspace ID? (copy your incorrect GIT_EDITOR workspace's URL)

Autostart Reset
image image

mustard-mh avatar Sep 25 '23 11:09 mustard-mh

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 23 '24 15:05 github-actions[bot]