Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal putting ANSI Escape Code in terminal line when attaching tmux session #16384

Closed
angadschawla opened this issue Nov 27, 2023 · 6 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@angadschawla
Copy link

angadschawla commented Nov 27, 2023

Windows Terminal version

1.18.2822.0

Windows build number

10.0.22621.0

Other Software

I am using Windows terminal to connect via SSH (openSSH on Windows) to Linux machine. Once connected I run tmux attach to connect to an already running tmux session. The shell on Linux is zsh.

Steps to reproduce

Whenever I run "tmux attach -t session_name".

Expected Behavior

I should just be attaching to a detached session.

Actual Behavior

Whenever I connect to the detached session in Tmux, I get this input "61;6;7;22;23;24;28;32;42c" which seem line ANSI escape codes. This is annoying as if there is a process going in that tmux session this messes up the visual output of the script already running.

I tried running the same command on a Mac Machine using terminal and iTerm 2, and this error does not happen.

Screenshot 2023-11-27 112934
@angadschawla angadschawla added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 27, 2023
@j4james
Copy link
Collaborator

j4james commented Nov 28, 2023

This is quite likely the same issue as #7185. And it was suggested there that upgrading SSH might help. The other suggestion was to set a longer escape-time value in your tmux config.

@angadschawla
Copy link
Author

Thank you, @j4james! That handled it. I used the escape-time suggestion.

@gangefors
Copy link

gangefors commented Feb 23, 2024

For anyone that ends up here and is using byobu, the tmux config is located at ~/.byobu/.tmux.conf.

This config ended up solving the issue for me.

$ cat ~/.byobu/.tmux.conf
set-option -s escape-time 50

@noapoleon
Copy link

noapoleon commented Apr 11, 2024

This does not fix it for me.
Also I get the exact same weird numbers "61;6;7;22;23;24;28;32;42c" but twice
I am using Windows Terminal version 1.19.10821.0
image

Here's my tmux config if that helps with anything
Right now escape-time is at 10 but I have tried from 10 to 10000 and it changes nothing
image

@sheen-justin
Copy link

@noapoleon I was getting pretty much the exact same issue. The culprit looks to be tmux-sensible.

In ${TMUX_PLUGIN_DIR}/tmux-sensible/sensible.tmux line 83 it sets tmux set-option -s escape-time 0. You can either modify this line to be a higher value or remove tmux-sensible from your .tmux.conf

@sheen-justin
Copy link

@noapoleon another option is to move the line set -sg escape-time 10 in your .tmux.conf from up top to immediately after the line set -g @plugin 'tmux-plugins/tmux-sensible'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

5 participants