gpt4 book ai didi

tmux - 退格键在 tmux 命令提示符下不起作用

转载 作者:行者123 更新时间:2023-12-04 00:04:25 57 4
gpt4 key购买 nike

我在 tmux 命令提示符下使用 Backspace 键时遇到问题。退格会删除 tmux 中的前一个字符(如预期的那样),但不会在 tmux 命令提示符下删除。例如,<PREFIX>:lists<DEL>不会删除 's' 字符。使用 C-h在这种情况下,而不是 Delete 键会删除 's' 字符。 C-?不会删除 's' 字符。我在 tmux 窗口中进行了一些调试:

$TERM=screen-256color
infocmp reports kbs=\177 (good)
appres XTerm | grep backarrowKeyIsErase reports as true (good)
appres XTerm | grep ptyInitialErase reports as true (good)
stty -a | grep erase reports as "^H" (bad, I think I want ^?)

我还尝试在 .tmux.conf 中绑定(bind) Backspace 键。如下图所示为 C-hC-? ,都不工作。 :list-keys在 tmux 内确认映射正在发生。
bind-key -n BSpace send-keys C-?

我已经完成了 stty erase ^?同样,在调用 tmux 之前和之后这不会影响行为。最后,我删除了我的 .tmux.conf完全并且仍然得到相同的行为。

命令行是否使用了会影响 BSpace 功能的一组不同的键绑定(bind)?

最佳答案

正如我从 Backspace bad behaviour #321 那里得到的那样:

I had the same problem (with backspace plus getting addition characters from auto completion) whenever I entered a tmux session. I removed the .tmux.conf and the problem disappeared so I changed the following in my .tmux.conf

changed from: set -g default-terminal "tmux-256color" to: set -gdefault-terminal "xterm-256color"

This solved the problem. Removing this line altogether also worked butit seemed better to be explicit.


这个对我有用。
注意:更改设置后,您可能需要运行
tmux kill-server
使更改生效。

关于tmux - 退格键在 tmux 命令提示符下不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51488920/

57 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com