You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LazyGit exits unpredictably while moving quickly through commits (on WSL only) #622
Describe the bug
When I move the cursor (up/down keys) through the commits (reflog) the app crashes. This only happens on WSL, not on my Mac (that works perfectly). Strangely the problem seems to happen less if I use the '-d' debug flag.
To Reproduce
Steps to reproduce the behavior:
Open lazygit in any repository directory in WSL
Use left/right arrows to move focus to the commits pane
Quickly use the up/down keyboard keys to shift focus. While I haven't been able to confirm this, it might be a race condition because some change sets are quite large.
Expected behavior
It should move focus without exiting.
I say "exit" because I get no logs in the console.. so it may not be a "crash" per se.
Desktop (please complete the following information):
Windows 10 WSL (Microsoft Windows [Version 10.0.18363.592])
Same bug at my machine, also with ConEmu (Cmder). I just tried the exact same interactions while using the default "bash console". And in this setup lazygit does not exit. So I am coming to the conclusion, that ConEmu is doing something weird. I'll look more into it.
would either of you happen to have a stack trace of the error, assuming it panics on exit? The fact that the debug flag has an impact tells me it's a concurrency issue and that maybe we need to put a mutex on something.
Hello, Same error there. Typing LEFT, RIGHT, UP, DOWN, PGUP, PGDOWN exits the program.
I use ConEmu and gitbash on Windows 7 64 bits SP1.
No stack trace, he just exits.
But in case of typing PGUP, the program exits and displays one tilde.
Sometimes typing UP exits and displays the character A.
Sometimes typing RIGHT exits and displays the character C.
I think I know what's going on: in terminal speak the up key is typically translated into ESC+A, and right is translated into ESC+C. So I think that after pressing a key the terminal is sending an escape sequence to the program but not fast enough to be interpreted as a single escape sequence, meaning it's taken as a literal escape key which therefore exits the program. The details probably differ but that's the gist I'm assuming.
I wonder if it's something to do with the value of the TERM variable. What do you get doing echo $TERM (assuming echo is a command windows recognises) @lkppo @carstengehling@paulcarroll
That sounds really promising @jesseduffield
Unfortunately i've completely moved from windows to mac recently and can't find that out 🤕 .... perhaps you have some insight @carstengehling ?
@jesseduffield I switched away from ConEmu ~8 months ago to use MS' own Windows Terminal instead. I have not experienced any of the above-mentioned problems since.
On that note: Lazygit works awesomely with Windows Terminal! I have just upgraded to 0.27.1 (using your PPA), and everything is just so smooth. Mouse integration - including scrolling with the mouse wheel - is just plain cool. :-)
Similar problems. I installed Conemu recently and tried lazygit and all kinds of problems making it useless. Never any problems with windows terminal. If I run lazygit outside a git and it pops up most recent I end up seeing 24;25; type of sequences that are constantly played "in the filter". I guess these are ANSI escape code's. If I disable ansi and xterm from features in conemu it works better but random keys seem to be sent or detected by lazygit.
I noticed the mode was WK, I went to xterm and it went back to flooding the the input (see image). I then selected windows W mode only and best I can tell it seems to be working.
When starting lazygit it start sets ConEmu to XABK mode and that seems to be the real problem.
AI: "You don’t have to turn K mode off for every program — it only matters for applications that rely on the application‑cursor (DECCKM) key sequences. Most Windows console programs (cmd, PowerShell, etc.) work fine with K mode enabled, but many terminal user interfaces (TUIs) that were written for a plain XTerm‑style terminal (like lazygit, vim, htop, ncdu, etc.) interpret those extra sequences as stray keystrokes.
So:
If you only use TUI tools that don’t care about DECCKM, you can leave K mode on and it won’t affect them.
If you run a TUI that expects plain XTerm input (as lazygit does), K mode will cause the “random key” behaviour. Disabling K mode for that specific tab (or launching the program with -new_console:p1) resolves the issue without harming other console applications.
In short, you don’t need a global K‑mode disable; just start the affected TUI (e.g., lazygit) in W mode only. All other console programs will continue to work as before."
"
Activity
carstengehling commentedon Feb 11, 2020
Same bug at my machine, also with ConEmu (Cmder). I just tried the exact same interactions while using the default "bash console". And in this setup lazygit does not exit. So I am coming to the conclusion, that ConEmu is doing something weird. I'll look more into it.
jesseduffield commentedon Feb 14, 2020
would either of you happen to have a stack trace of the error, assuming it panics on exit? The fact that the debug flag has an impact tells me it's a concurrency issue and that maybe we need to put a mutex on something.
jesseduffield commentedon Feb 14, 2020
I've got a PR up that may fix the issue: let me know if it works :) #643
carstengehling commentedon Feb 18, 2020
It does not seem to panic - just exit. Unless there is somewhere in WSL where I could look for a logfile?
Thanks for the possible bugifx, I'll try to see if I can build the PR today and test it.
saulery commentedon Mar 26, 2020
Hello, Same error there. Typing LEFT, RIGHT, UP, DOWN, PGUP, PGDOWN exits the program.
I use ConEmu and gitbash on Windows 7 64 bits SP1.
No stack trace, he just exits.
But in case of typing PGUP, the program exits and displays one tilde.
Sometimes typing UP exits and displays the character A.
Sometimes typing RIGHT exits and displays the character C.
jesseduffield commentedon Aug 24, 2020
I think I know what's going on: in terminal speak the up key is typically translated into ESC+A, and right is translated into ESC+C. So I think that after pressing a key the terminal is sending an escape sequence to the program but not fast enough to be interpreted as a single escape sequence, meaning it's taken as a literal escape key which therefore exits the program. The details probably differ but that's the gist I'm assuming.
I wonder if it's something to do with the value of the TERM variable. What do you get doing
echo $TERM(assumingechois a command windows recognises) @lkppo @carstengehling @paulcarrolltreefitty commentedon Aug 24, 2020
That sounds really promising @jesseduffield
Unfortunately i've completely moved from windows to mac recently and can't find that out 🤕 .... perhaps you have some insight @carstengehling ?
cseickel commentedon Jan 4, 2021
I am having the same problem, using WSL in ConEmu on Windows 10. I am running this in tmux if that makes a difference.
echo $TERM outputs: screen-256color
jesseduffield commentedon Apr 6, 2021
@carstengehling @lkppo @cseickel could you guys try this out on the latest release? We're using a new rendering library which may fix the issue
carstengehling commentedon Apr 8, 2021
@jesseduffield I switched away from ConEmu ~8 months ago to use MS' own Windows Terminal instead. I have not experienced any of the above-mentioned problems since.
carstengehling commentedon Apr 8, 2021
On that note: Lazygit works awesomely with Windows Terminal! I have just upgraded to 0.27.1 (using your PPA), and everything is just so smooth. Mouse integration - including scrolling with the mouse wheel - is just plain cool. :-)
Universal-Invariant commentedon Oct 27, 2026
Similar problems. I installed Conemu recently and tried lazygit and all kinds of problems making it useless. Never any problems with windows terminal. If I run lazygit outside a git and it pops up most recent I end up seeing 24;25; type of sequences that are constantly played "in the filter". I guess these are ANSI escape code's. If I disable ansi and xterm from features in conemu it works better but random keys seem to be sent or detected by lazygit.
I noticed the mode was WK, I went to xterm and it went back to flooding the the input (see image). I then selected windows W mode only and best I can tell it seems to be working.
When starting lazygit it start sets ConEmu to XABK mode and that seems to be the real problem.
AI: "You don’t have to turn K mode off for every program — it only matters for applications that rely on the application‑cursor (DECCKM) key sequences. Most Windows console programs (cmd, PowerShell, etc.) work fine with K mode enabled, but many terminal user interfaces (TUIs) that were written for a plain XTerm‑style terminal (like lazygit, vim, htop, ncdu, etc.) interpret those extra sequences as stray keystrokes.
So:
If you only use TUI tools that don’t care about DECCKM, you can leave K mode on and it won’t affect them.
If you run a TUI that expects plain XTerm input (as lazygit does), K mode will cause the “random key” behaviour. Disabling K mode for that specific tab (or launching the program with -new_console:p1) resolves the issue without harming other console applications.
In short, you don’t need a global K‑mode disable; just start the affected TUI (e.g., lazygit) in W mode only. All other console programs will continue to work as before."
"
chrisant996/clink#722