mirror of
https://github.com/tmux/tmux.git
synced 2024-12-25 10:58:48 +00:00
Fix backspace option for new key format, GitHub issue 4284.
This commit is contained in:
parent
01edce40f3
commit
6d792e4123
@ -586,9 +586,11 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
|
|||||||
/* Is this backspace? */
|
/* Is this backspace? */
|
||||||
if ((key & KEYC_MASK_KEY) == KEYC_BSPACE) {
|
if ((key & KEYC_MASK_KEY) == KEYC_BSPACE) {
|
||||||
newkey = options_get_number(global_options, "backspace");
|
newkey = options_get_number(global_options, "backspace");
|
||||||
if (newkey >= 0x7f)
|
if (newkey == KEYC_BSPACE)
|
||||||
newkey = '\177';
|
newkey = '\b';
|
||||||
key = newkey|(key & (KEYC_MASK_MODIFIERS|KEYC_MASK_FLAGS));
|
log_debug("%s: key 0x%llx is backspace -> 0x%llx", __func__,
|
||||||
|
key, newkey|(key & KEYC_MASK_FLAGS));
|
||||||
|
key = newkey|(key & KEYC_MASK_FLAGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Is this backtab? */
|
/* Is this backtab? */
|
||||||
@ -610,6 +612,7 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
|
|||||||
if (!(key & ~KEYC_MASK_KEY)) {
|
if (!(key & ~KEYC_MASK_KEY)) {
|
||||||
if (key == C0_HT ||
|
if (key == C0_HT ||
|
||||||
key == C0_CR ||
|
key == C0_CR ||
|
||||||
|
key == C0_BS ||
|
||||||
key == C0_ESC ||
|
key == C0_ESC ||
|
||||||
(key >= 0x20 && key <= 0x7f)) {
|
(key >= 0x20 && key <= 0x7f)) {
|
||||||
ud.data[0] = key;
|
ud.data[0] = key;
|
||||||
|
@ -894,6 +894,7 @@ first_key:
|
|||||||
if (onlykey < 0x20 &&
|
if (onlykey < 0x20 &&
|
||||||
onlykey != C0_HT &&
|
onlykey != C0_HT &&
|
||||||
onlykey != C0_CR &&
|
onlykey != C0_CR &&
|
||||||
|
onlykey != C0_BS &&
|
||||||
onlykey != C0_ESC) {
|
onlykey != C0_ESC) {
|
||||||
onlykey |= 0x40;
|
onlykey |= 0x40;
|
||||||
if (onlykey >= 'A' && onlykey <= 'Z')
|
if (onlykey >= 'A' && onlykey <= 'Z')
|
||||||
|
Loading…
Reference in New Issue
Block a user