mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 19:31:14 -03:00
"commandline -f foo" to skip queue and execute immediately
Commit c3cd68dda (Process shell commands from bindings like regular char
events, 2024-03-02) mentions a "weird ordering difference".
The issue is that "commandline -f foo" goes through the input
queue while other commands are executed directly.
For example
bind ctrl-g "commandline -f end-of-line; commandline -i x"
is executed in the wrong order. Fix that.
This doesn't yet work for "commandline -f exit" but that can be fixed easily.
It's hard to imagine anyone would rely on the existing behavior. "commandline
-f" in bindings is mostly used for repainting the commandline.
This commit is contained in:
@@ -358,6 +358,20 @@ send('\x02\x02\x02') # ctrl-b, backward-char
|
||||
sendline('\x1bu') # alt+u, upcase word
|
||||
expect_prompt("fooBAR")
|
||||
|
||||
send("""
|
||||
bind ctrl-g "
|
||||
commandline --insert 'echo foo ar'
|
||||
commandline -f backward-word
|
||||
commandline --insert b
|
||||
commandline -f backward-char
|
||||
commandline -f backward-char
|
||||
commandline -f delete-char
|
||||
"
|
||||
""")
|
||||
send('\x07') # ctrl-g
|
||||
send('\r')
|
||||
expect_prompt("foobar")
|
||||
|
||||
# Check that the builtin version of `exit` works
|
||||
# (for obvious reasons this MUST BE LAST)
|
||||
sendline("function myexit; echo exit; exit; end; bind ctrl-z myexit")
|
||||
|
||||
Reference in New Issue
Block a user