garbage characters left in terminal on exit
Describe the bug
I'm using lazygit over a SSH connection (using Windows Terminal with TERM=xterm-256) while visiting the UK to my Linux workstation in Austin, TX, so there's some latency. When I exit lazygit, I'm consistently seeing output like this on my terminal
❯ lazygit
^[[81;16;113;0;32;1_
bcombee in 🌐 atx-bcombee-mousetrap in os on main [$⇣] took 2s
❯ 1;16;113;0;32;1_
The same version of lazygit run locally in a WSL VM doesn't show this behavior, making me think it has something to do with response latency to terminal queries.
To Reproduce
Steps to reproduce the behavior:
- Open a SSH connection to a machine with roughly 140ms ping time
- start lazygit
- hit "q" to quit
- See terminal response output on your console where you have to delete it to enter a new command.
Expected behavior
Nothing is output extra on terminal after program exit
Version info:
- its a locally built copy using
go install github.com/jesseduffield/lazygit@latestthis afternoon (Feb 5 2026)
Terminal info:
Windows Terminal Preview 1.24.10212.0
I can only suspect that this has something to do with the heuristic that's needed for detecting escape sequences. This is timing-based, so escape sequences will only be detected as such if the next character after the escape arrives within so many milliseconds. Maybe your network latency (or rather, jitter) is so bad that sometimes there's a longer gap after the escape.
I didn't think it through whether this would explain what you're seeing, it's just a wild guess.
I'll soon be back closer to my server, so many not be able to reproduce. I wonder if the TUI library could have a heuristic to wait for some period of time (maybe based on earlier measurements of latency during the current run) for a response from its last terminal query before exiting the loop that consumes input.
I'll soon be back closer to my server, so many not be able to reproduce. I wonder if the TUI library could have a heuristic to wait for some period of time (maybe based on earlier measurements of latency during the current run) for a response from its last terminal query before exiting the loop that consumes input.
I wonder if the TUI library could have a heuristic to wait for some period of time (maybe based on earlier measurements of latency during the current run) for a response from its last terminal query before exiting the loop that consumes input.
Yeah, maybe. If you want that improvement, you'll have to file an issue in the tcell repo though, not here.
I am having the same problem in my WSL setup. I am using a Windows 11 host with WSL version 2.6.3.0, and when I upgraded lazygit to 0.59.0 I started having this issue, I have been using it for a few years now without any problems.
I am using alacritty version 0.16.1.
I am having the same problem in my WSL setup. I am using a Windows 11 host with WSL version 2.6.3.0, and when I upgraded lazygit to
0.59.0I started having this issue, I have been using it for a few years now without any problems. I am using alacritty version 0.16.1.![]()
The same applies to me.
Windows 11 / WSL 2.6.3.0 / wezterm 20240203-110809-5046fc22