mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00: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
1 changed files with 10 additions and 2 deletions
|
@ -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 a new issue