-
-
Notifications
You must be signed in to change notification settings - Fork 679
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
Backspace does not work with tmux #88
Comments
What does
|
Delete key is acting as Backspace. |
Inside tmux
Outside tmux
|
Inside tmux
|
Hmm, you might try adding this option to your
More information about this option here: |
With that option the delete stops working. |
I've been trying to reproduce this locally but without luck. I suspect that there is some other local configuration that is impacting things, but it's not clear at which layer. Since this seems to only be an issue inside tmux, it might be something to do with its configuration. Would you mind sharing your tmux configuration file? What I usually do to sanity check this sort of input issue is to run
Could you try that both outside and inside your tmux session? |
tmux works out what to expect for backspace by looking at VERASE. From your stty output, it looks like you have ^? - if the terminal actually sends ^H, tmux will not correctly recognise backspace. tmux will always send ^? for backspace to applications inside, if you want ^H you will need to build tmux from master and change the tmux will expect |
Thanks @nicm; that's helpful! I still can't reproduce this locally, so I'm wondering whether @rbelem has a keyboard that has Backspace/Delete swapped. If so, then that |
Previously we would try to pass through the Backspace and Delete code points without interference, but that behavior wasn't quite right. With this commit our behavior is now: - At the window layer: Classify a `Backspace` key press as logically `BS` and a `Delete` key press as logically `DEL` unless the `swap_backspace_and_delete` is true (macOS is true by default), in which case `Backspace` is mapped to `Delete` and vice versa. - At the terminal input layer: A `Backspace` input from the Window sends the `DEL` sequence to the pty as that matches the default `VERASE` stty configuration. A `Delete` input from the Window emits `\033[3~`, which matches up to the `TERMINFO` for `xterm-256color` which we claim to be compatible with, and is our default `$TERM` value. The net result of this is that `Backspace` will now start to emit `^?` which should match folks stty verase. Heads up to @fanzeyi! I've tested this only on a linux system so far and will follow up on a macOS system a little later today. Refs: #88 Refs: #63
@wez my keyboard is a regular keyboard type. The bug behavior is reproducible only with wezterm+tmux+bash. In the same session when I use wezterm+tmux+neovim in insert mode it works as expected, but it doesn't when using wezterm+tmux+neovim in command mode. |
@rbelem: could you test with the latest nightly build and see if things are better? |
I just built the HEAD and it is working \o/ |
With the changes in Refs: #88 we don't need to swap them by default on macos any more.
HEAD is working and release 20191229-193639-e7aa2f3 is not. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Describe the bug
The backspace key stops working when using tmux. After exiting tmux it works again.
Environment (please complete the following information):
Is it a build problem?
No
To Reproduce
Open tmux, type something and try to delete with backspace.
Configuration
None
Expected behavior
Delete the text
Screenshots
None
Session Recording
Issue with input
Additional context
The text was updated successfully, but these errors were encountered: