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

tmux prints garbage around prompt after attaching when escape-time is 0 #1638

Closed
robbiev opened this issue Jan 27, 2017 · 5 comments
Closed
Labels

Comments

@robbiev
Copy link

robbiev commented Jan 27, 2017

Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!

  • A brief description

Setting the tmux escape time to zero prints escape code garbage around the initial prompt. It also happens when re-attaching tmux after detaching. It does not happen when creating windows inside tmux. The garbage printed looks like responses to terminal type queries (see http://docstore.mik.ua/orelly/unix/upt/ch05_05.htm and the response for base VT100 there) that I guess tmux does when attaching.

echo "set -s escape-time 0" > testtmux.conf
tmux -f testtmux.conf
  • Expected results

I expect the prompt to look like this:
robbie@SERIES9:~$

  • Actual results (with terminal output if applicable)

Some escape code garbage is printed around the prompt:
^[[?1;0crobbie@SERIES9:~$ 1;0c

  • Your Windows build number
    10.0.14393 Build 14393

  • Steps / All commands required to reproduce the error from a brand new installation

sudo apt-get install tmux
echo "set -s escape-time 0" > testtmux.conf
tmux -f testtmux.conf
  • Strace of the failing command
    /

  • Required packages and commands to install
    tmux

See our contributing instructions for assistance.

@zadjii-msft
Copy link
Member

Out of curiosity, @robbiev why are you setting escape-time to 0? I haven't really seen this before, so I'll investigate it, but I'm curious why someone would do this.

@robbiev
Copy link
Author

robbiev commented Jan 28, 2017

I think the reason was as described in the "Faster Command Sequences" section here: https://mutelight.org/practical-tmux

Upon starting to use tmux, I noticed that I had to add a noticeable delay between two characters in a command sequence for it to recognize the command, for example between the C-a and n in C-a n. This is because tmux is waiting for an escape sequence. Fix that by setting escape time to zero.

I've had this in my tmux.conf for ages and I've never had any problems on Linux or OS X.

@imakahn
Copy link

imakahn commented Jan 28, 2017

This is also commonly used by VIM users inside tmux - without this setting, one has to wait for the standard delay to pass before hitting ESC returns to command mode, etc.

@v-iam
Copy link

v-iam commented May 17, 2017

I had this problem too, but setting escape-time to 20 seems to be (for me at least) an acceptable workaround.

@bitcrazed
Copy link
Contributor

Thanks for the discussion.

Closing this issue since:

  1. This issue is very old and has likely been fixed in recent Win10 builds
  2. This is the WSL issues repo, but this is an issue in Console which has its own Console GitHub Repo
  3. GitHub doesn't allow issues to be moved between repos, preserving posters' identity :(

If you have further asks/issues, please file new issues on our Console GitHub Repo.

kanglib added a commit to kanglib/dotfiles that referenced this issue Oct 16, 2019
kanglib added a commit to kanglib/dotfiles that referenced this issue Oct 16, 2019
kanglib added a commit to kanglib/dotfiles that referenced this issue Oct 16, 2019
yous added a commit to yous/dotfiles that referenced this issue Mar 28, 2021
r-darwish added a commit to r-darwish/config-files that referenced this issue Mar 30, 2021
Fixes an issue with the Windows terminal.
See microsoft/WSL#1638
drrlvn added a commit to drrlvn/config-files that referenced this issue Mar 30, 2021
See: microsoft/WSL#1638

The plugin tmux-sensible sets escape-time to 0, which display an escape
character in tmux under Windows Terminal. Setting the value to 20 is a
sensibler default which also works around the issue.
pr0v3rbs added a commit to pr0v3rbs/dotfiles that referenced this issue Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants