Skip to content

fix(lazygit): nvim opening over itself#2685

Open
BirdeeHub wants to merge 1 commit intofolke:mainfrom
BirdeeHub:lazygit
Open

fix(lazygit): nvim opening over itself#2685
BirdeeHub wants to merge 1 commit intofolke:mainfrom
BirdeeHub:lazygit

Conversation

@BirdeeHub
Copy link

@BirdeeHub BirdeeHub commented Jan 22, 2026

Makes workarounds like this no longer necessary:

https://github.com/BirdeeHub/nix-wrapper-modules/blob/48b4a74b16a800f57c4ef4c1b10cfe46bb7847d3/templates/neovim/init.lua#L306-L347

I have had this fixed for a few months in my own config with this method and it has solved my annoyance. Realized it was easier to extract than I thought.

@github-actions github-actions bot added core lazygit size/m Medium PR (<50 lines changed) labels Jan 22, 2026
@BirdeeHub
Copy link
Author

BirdeeHub commented Jan 22, 2026

Actuallly this may be a bug in lazygit

[ -z "$NVIM" ] && (nvim -- {{dir}}) || (nvim --server "$NVIM" --remote-send "q" && nvim --server "$NVIM" --remote-tab {{dir}})

I think they have their logic wrong here, the () don't look like they are doing what the author intended.

https://github.com/jesseduffield/lazygit/blob/19605ad47699888da471ddf17bd2ae6dbb1abf3a/pkg/config/editor_presets.go#L64-L66

Regardless, using vim.v.progpath has guarantees that just using the nvim command does not and we should implement these here.

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

Labels

core lazygit size/m Medium PR (<50 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant