vscode-gitlens
vscode-gitlens copied to clipboard
GitLens Interactive Rebase UI does not start when starting rebase from shell
Description
On macOS Ventura 12.6 with iTerm 3.4.16 and zshell:
When I start an interactive git rebase via git rebase -i, Visual Studio Code opens git-rebase-todo in a standard editor pane instead of GitLens starting its interactive rebase UI.
I have GitLens rebase turned on and in my .gitconfig, I added editor = code --wait.
When I uninstall GitLens and then, reinstall it, the GitLens rebase UI will briefly start working again but will eventually revert back to the VSCode standard editor after a few rebases.
GitLens Version
13.0.3
VS Code Version
Version: 1.72.2 (Universal) Commit: d045a5eda657f4d7b676dedbfa7aab8207f8a075 Date: 2022-10-12T22:16:30.254Z Electron: 19.0.17 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Darwin x64 21.6.0 Sandboxed: No
Git Version
git version 2.38.1
Logs, Screenshots, Screen Captures, etc
No response
We believe this issue should be resolved in the latest pre-release edition of GitLens. Can you please give it a try to confirm that the issue is resolved for you? Thanks!
You can switch to the pre-release edition of GitLens, by clicking on the "Switch to Pre-Release version of this extension" from the Extensions view.

This morning, I uninstalled/reinstalled the latest GitLens pre-release version and rebasing within VSCode is still using its based editor. The screenshot below shows the version of GitLens I am using and the screencast below shows what happens when I rebase. Please let me know if you would like me to collect and provide any additional information.

I encounter the same bug with mac os Monterey even if i start the rebase from vsCode terminal or iTerm.
Using the pre-release version the interactive rebase UI appear one time and switch to normal text editor commit message after.
I have the same issue.
If I type: git rebase -i HEAD~3 it will only open VS Code Text Editor

But, if I first open VS Code and then use: git rebase -i HEAD~3, then Git Lens will work

I tried different versions of Git Lens (including prelease) but nothing fixed the issue. And I tried to to enter command with Git CMD, CMD and Visual Studio but nothing worked. Also all my friends have the same issue.
I'm using Windows 10 Pro and this is VS Code version:

I am encountering this problem as well. It seems like the editor fails to load correctly when it opens in a new VS Code window. My sequence.editor command was code --wait --new-window, and it now fails to load the editor 100% of the time. When I remove --new-window the behavior seems to be consistent. If VS Code window is already open when I do the rebase, the editor loads. It doesn't seem to matter what is open in VS Code (even no file or folder), just the fact that it's already open. If VS Code is not open, the editor fails to load.
When the editor fails to load I get the following errors in the GitLens output:
[2023-04-21 20:25:49.117] [GIT ] [c:\Users\xxx\Projects\xxx\.git\rebase-merge] git rev-parse --show-toplevel • Command failed: C:\Program Files\Git\cmd\git.exe -c core.longpaths=true -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel • this operation must be run in a work tree • 154 ms
[2023-04-21 20:25:49.241] [GIT ] [c:\Users\xxx\Projects\xxx\.git] git rev-parse --show-toplevel • Command failed: C:\Program Files\Git\cmd\git.exe -c core.longpaths=true -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel • this operation must be run in a work tree • 63 ms
Further to @Smayke95 's https://github.com/gitkraken/vscode-gitlens/issues/2294#issuecomment-1312748745, when I use interactive rebase in the VSCode terminal the Gitlens UI does not launch. But if I use an external terminal app it opens the UI as expected.
Steps:
- With .gitconfig setting
editor = code --wait - Open a local repo in VSCode
- Open the the VSCode integrated terminal
- Run
git rebase -i HEAD~3
Expected:
GitLens Interactive Rebase UI is displayed
Actual:
- Git
.git/rebase-merge/git-rebase-todofile is opened - GitLens output log:
[xxx.git] git rev-parse --show-toplevel • Command failed: /opt/homebrew/bin/git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel • this operation must be run in a work tree [4ms]
Environment:
- MacOS 13.4.1 (Apple M1)
- VSCode 1.81.1 (Universal)
- GitLens v14.2.1
- git 2.41.0
I'm also hitting this issue on the latest releases. Similar to what others said, if I have VSCode already open, Interactive Rebase only works from my external terminal, iTerm, but not from VSCode's internal terminal.
The same issue seems to be reported earlier in #2051 and I've also started a discussion on the issue, but didn't receive any response.
Environment:
- MacOS 14.2.1
- VSCode 1.86.1
- GitLens v14.8.0
- Git v2.42.0
For me interactive rebase works only if VS Code is already open.