tmux prints chars on session start
skwde opened this issue · comments
On session start tmux prints 0;10;1c
.
See also here: microsoft/WSL#5931.
This seems to be related to escape-time.
In ~/.tmux.conf
set -sg escape-time 10
fixes the issue for me.
Seems it works only for the first time start a Session, if you exit current session and run tmux
again, prints chars again.
Can we somehow identify WSL (with an env var for example) so we can set escape-time 10
just in that case?
@roachsinai , hm ok, I understand now.
Well, I'd be ok with fixing the problem for the first try at least.
Please update this thread if you find a proper solution.
@roachsinai, is your issue reproducible? For me setting tmux set-option -g escape-time 50
completely fixed the issue and it does not reappear when detaching and attaching to a session.
Edit: I was too eager to announce the issue being solved for me. I have all my config (except declaration of plugins) in a shell script that I call with run-shell
and the characters only stop appearing when I place set-option -g escape-time 50
right in front of the run-shell
.
I have very much the same issue not in WSL but on FreeBSD 13.1 and FreeBSD 14.0 (ssh-ed in from Windows Terminal). Increasing escape-timeout
seems to fix the problem.
This reduces the frequency of the problem for me, but does not eliminate it. I'm shelling from Windows 11 into a remote Debian Bullseye bash. I have tried escape-time values of 0, 10, 20, and 50.
I also have escape-time
set to 0 and having this issue in the Windows 11 command prompt SSHing into an Ubuntu server when using tmux version 3.2a and newer.
Interestingly, this problem does not occur in the older version 3.1c.
Setting escape-time
to something greater than 0 also works, but I prefer sticking to the older TMUX version at this point. Hoping this issue will be addressed some day 🤞
The problem still occurs for me after downgrading to 3.1c on Debian Bullseye.
I think I might have fixed it. For some reason, setting the environment variable TERM
to tmux-256color
before attaching to tmux seems to solve the problem for me. I will update this post if this ends up not working. Let me know if it also works for you.
EDIT: thinking about it a bit more, it makes sense that this solves the issue. The terminal is no longer queried for the capabilities by tmux, because tmux already has already been told about the capabilities via TERM
.
For reference, this what I put in my .profile
to fix it, explain why it works, and the assumption behind it.
I think I might have fixed it. For some reason, setting the environment variable
TERM
totmux-256color
before attaching to tmux seems to solve the problem for me. I will update this post if this ends up not working. Let me know if it also works for you.
This does solve the problem also for me (I used to have TERM=xterm-256color
, but changes the colours on my nvim theme, which is kind of uncomfortable.
Thanks, this works for me too. Great workaround.