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
Tmux shows control sequences during attach or resize #4541
I tried building the HEAD of master, but I can't run it at all. I just get:
$ ./tmux
open terminal failed: not a terminal
This is similar to #4535, except that bug was closed because the reporter was not cooperating. I don't mind trying to debug this. I tried adding a bunch of options to my .tmux.conf based on some googling, including:
# Trying to debug terminal escape codes showing up in tmux sessions
set-option -g default-terminal "tmux-256color"
set-option -g set-clipboard off
set-window-option -g xterm-keys off
set-option -g terminal-overrides ',xterm-256color:RGB@:Tc@' # Using your confirmed non-hyphenated TERM
set-option -g allow-passthrough off
set-option -g set-titles on # Explicitly set to 'on'
And while it might be less common with those settings, it still happens.
I have tried Microsoft Terminal, and Mintty (I'm running Windows 11, running a terminal, and then sshing into Fedora 42).
I built from master using the instructions in the repo:
git clone https://github.com/tmux/tmux.git
cd tmux
./configure && make
$ ./tmux
open terminal failed: not a terminal
If you try it a few times does the output change, or does it always stay the same?
You'll need to press C-c each time to get back to the prompt.
Run tmux with strace, reproduce and show me the strace.out file:
strace -vvttt -fostrace.out ./tmux -Ltest -f/dev/null new
I think this is an issue that came up before on Windows and is because there are a number of layers on Windows that handle escape sequences and they do not seem to play nicely together.
I have a single ssh connection, with a single client. But that ssh connection drops occasionally (I'm on a laptop and I'm constantly switching from docking-station to wifi to VPN). When it drops, it tries to automatically reconnect and run tmux attach. The new client probably attaches before the old client times out; but my goal is to only have 1 client at a time.
OK, problem is that your terminals are being slow to respond, although for some reason not all the time. It could be network, but this was happening before and it was something to do with Window. For example, in your log tmux gets this:
1750784565.300206 /dev/pts/6: keys are 70 (\033[?64;1;2;4;6;9;11;15;21;22;28;29c\033[>77;30708;0c\033P>|mintty 3.7.8\033\\\033]10)
1750784565.324975 /dev/pts/6: keys are 46 (;rgb:1010/3030/3030\033\\\033]11;rgb:d1d1/f4f4/d6d6\033\\)
So it gets part of the responses (to DA, DA2, XDA and the start of the colours), then it is not until another 24 milliseconds later that it gets the rest. By this time tmux has decided (because the default escape-time is 10 milliseconds) that the first bit of the colours (\033]10) was in fact you pressing M-] then 10, and so on for the rest of the response.
We already worked around this by automatically extending escape-time if we are waiting for DA, DA2, XDA, so we can just extend that to include the colours as well. Try this please: x.diff.txt
I want to mention that I was reproducing this issue when I upgraded from tmux 2.6 to 3.5a. Checking out 7e43953 master as of today has solved the issues for me.
Activity
nicm commentedon Jun 24, 2025
What terminal are you using?
How did you build tmux from master? You need to try with master because there is a good chance this is fixed.
solace-rcampbell commentedon Jun 24, 2025
I have tried Microsoft Terminal, and Mintty (I'm running Windows 11, running a terminal, and then sshing into Fedora 42).
I built from master using the instructions in the repo:
nicm commentedon Jun 24, 2025
Show config.log please.
nicm commentedon Jun 24, 2025
Are you killing your existing tmux? You can't mix old server and new client. If you don't want to do that, use
tmux -Ltest.solace-rcampbell commentedon Jun 24, 2025
Sorry, I thought I had killed my old tmux v3.5, but I had some old stuck processes.
Anyway, now that I really killed all the old processes, I can start the one built from "master".
I will try to reproduce it using the "master" version.
solace-rcampbell commentedon Jun 24, 2025
I just reproduced it with the "master" build:
nicm commentedon Jun 24, 2025
Show server log please from reproducing with master.
solace-rcampbell commentedon Jun 24, 2025
tmux-server-3744068.log
Here is the server log from my reproduction.
nicm commentedon Jun 24, 2025
Can you do two things:
If you try it a few times does the output change, or does it always stay the same?
You'll need to press
C-ceach time to get back to the prompt.strace, reproduce and show me thestrace.outfile:I think this is an issue that came up before on Windows and is because there are a number of layers on Windows that handle escape sequences and they do not seem to play nicely together.
solace-rcampbell commentedon Jun 24, 2025
nicm commentedon Jun 24, 2025
Actually, never mind, this log is confusing because you have two clients, so it is not what I thought.
solace-rcampbell commentedon Jun 24, 2025
I have a single ssh connection, with a single client. But that ssh connection drops occasionally (I'm on a laptop and I'm constantly switching from docking-station to wifi to VPN). When it drops, it tries to automatically reconnect and run tmux attach. The new client probably attaches before the old client times out; but my goal is to only have 1 client at a time.
nicm commentedon Jun 24, 2025
OK, problem is that your terminals are being slow to respond, although for some reason not all the time. It could be network, but this was happening before and it was something to do with Window. For example, in your log tmux gets this:
So it gets part of the responses (to DA, DA2, XDA and the start of the colours), then it is not until another 24 milliseconds later that it gets the rest. By this time tmux has decided (because the default
escape-timeis 10 milliseconds) that the first bit of the colours (\033]10) was in fact you pressingM-]then10, and so on for the rest of the response.We already worked around this by automatically extending
escape-timeif we are waiting for DA, DA2, XDA, so we can just extend that to include the colours as well. Try this please: x.diff.txtczipperz commentedon Jul 8, 2025
I want to mention that I was reproducing this issue when I upgraded from tmux 2.6 to 3.5a. Checking out 7e43953 master as of today has solved the issues for me.
czipperz commentedon Jul 8, 2025
I spoke too soon. I am now reproducing this again.
zzeitt commentedon Jul 10, 2025
Found a workaround from Windows Terminal issues:
TL;DR:
In your
tmux.conf20250713 edit:
nicm commentedon Jul 13, 2025
Nobody tested this fix but it looks right to me so I have applied it.
github-actions commentedon Aug 13, 2025
This issue has been automatically locked since there has not been any recent activity after it was closed.