mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 03:03:57 +08:00
fix bind
command example given by fkr
The `fish_key_reader` program emits an example `bind` command for the sequence of keystrokes it sees. However, if that sequence includes a space or del character the example `bind` command includes extraneous commentary that makes the command invalid. Fixes #3262
This commit is contained in:
parent
710addde16
commit
2dbc7ddcb8
|
@ -124,10 +124,18 @@ static char *char_to_symbol(wchar_t wc, bool bind_friendly) {
|
|||
}
|
||||
} else if (wc == ' ') {
|
||||
// The "space" character.
|
||||
snprintf(buf, sizeof(buf), "\\x%X (aka \"space\")", wc);
|
||||
if (bind_friendly) {
|
||||
snprintf(buf, sizeof(buf), "\\x%X", wc);
|
||||
} else {
|
||||
snprintf(buf, sizeof(buf), "\\x%X (aka \"space\")", wc);
|
||||
}
|
||||
} else if (wc == 0x7F) {
|
||||
// The "del" character.
|
||||
snprintf(buf, sizeof(buf), "\\x%X (aka \"del\")", wc);
|
||||
if (bind_friendly) {
|
||||
snprintf(buf, sizeof(buf), "\\x%X", wc);
|
||||
} else {
|
||||
snprintf(buf, sizeof(buf), "\\x%X (aka \"del\")", wc);
|
||||
}
|
||||
} else if (wc < 0x80) {
|
||||
// ASCII characters that are not control characters.
|
||||
if (bind_friendly && must_escape(wc)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user