tmux-plugins / tmux-sensible

basic tmux settings everyone can agree on
MIT License
1.73k stars 90 forks source link

Raise escape-timeout from 0 to 1 #60

Open mbaezner opened 3 years ago

mbaezner commented 3 years ago

Raise escape-timeout from 0 to 1 to avoid catching Bash color codes when loading several components in the .bashrc file on Windows Subsystem for Linux 2.

image

Blosberg commented 1 year ago

I support this for a plugin that's intended to be a "sensible" set of defaults that noone can object to. No human being will ever perceive a delay of 1 ms, and it patches Issue #61 for WSL users.

d1rebear commented 1 year ago

This makes sense, let's merge it

MJJBennett commented 10 months ago

Not sure if this repository is maintained but this change did fix similar issues for me in WSL2. (Very) difficult problem to diagnose, so it definitely seems like this patch would be useful to have and prevent future headaches. It's also worth noting that the SuperUser answer that is cited in this setting's comment in the plugin explicitly discourages doing what the plugin is doing (although, that seems to be an edit more recent than this PR, so):

As pointed out [...] setting an escape time of zero is a bad idea but rather, set it to a low enough value such that you are not bothered by the delay.

For more rationale as to why this configuration setting is a poor idea [and definitely does not fit the stated purpose of this repository], see the referenced answer here: https://superuser.com/a/1809494

Not sure if any additional information is required to merge this PR as it has been sitting untouched for over two years.

buckley310 commented 9 months ago

As of tmux 3.4 (which is not released yet), tmux will actually stop you from setting this value to 0. So yeah, +1 on merging this.

ref https://github.com/tmux/tmux/commit/201a8d8e7eb0bf208918c698e64aa120864c6dfc https://github.com/wez/wezterm/issues/2060#issuecomment-1143775552

AngeloThys commented 7 months ago

It's a sensible default value, as stated by various sources:

tmux set-option -s escape-time 0 interrupts and even breaks behaviour on various terminals/platforms

Even if tmux 3.4 fixes this by hardcoding a change from 0 to 1, the previous versions should still be able to benefit from this plugin without experiencing breaking behaviour.

buckley310 commented 7 months ago

The description of escape-time in README.md still says 0. This PR should probably include a change to that as well.

nathan-mhk commented 4 months ago

The version of tmux installed with sudo apt install tmux on WSL 2 (running Ubuntu 22.04.4 LTS) is 3.2a. I got the escape sequence ^[[>0;10;1c leaking into the shell and it took me a whole day to find out that this is the cause of the problem. Raising the value to 1 is enough for the leaking to stop.