mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 19:41:14 -03:00
fish_key_reader: Only name keys if they match the entire sequence
This would misname `\e\x7F` as "backspace": bind -k backspace 'do something' bind \e\x7F 'do something' because it would check if there was any key *in there*. This was probably meant for continuous mode, but it simply doesn't work right. It's preferable to not give a key when one would work over giving one when it's not correct.
This commit is contained in:
@@ -38,6 +38,13 @@ sleep(0.020)
|
||||
send("\x00")
|
||||
expect_str("char: \\c@\r\nbind -k nul 'do something'\r\n")
|
||||
|
||||
# Ensure we only name the sequence if we match all of it.
|
||||
# Otherwise we end up calling escape+backspace "backspace"!
|
||||
send("\x1b\x7f")
|
||||
expect_str('char: \\e\r\n')
|
||||
expect_str('char: \\x7F')
|
||||
expect_str('''(aka "del")\r\nbind \\e\\x7F 'do something'\r\n''')
|
||||
|
||||
# Does it keep running if handed control sequences in the wrong order?
|
||||
send("\x03")
|
||||
sleep(0.010)
|
||||
|
||||
Reference in New Issue
Block a user