mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 10:30:28 +08:00
789a280ee8
Today, bind foo "commandline -f expand-abbr; commandline -i \n" does not work because this 1. enqueues an expand-abbr readline event 2. "commandline -i" inserts \n 3. processes the expand-abbr readline event Since there is no abbreviation on the new line, this doesn't do anything. PR https://github.com/fish-shell/fish-shell/pull/9398 would fix this particular instance however it does not fix the issue that "commandline -i" is run before the expand-abbr is processed by the reader. This is harmless here but there would be a problem if "commandline" tried to read commandline state that was created by a preceding command. It's not super clear to me whether the above binding should work as one would naively expect. That would imply that "commandline" would need to drain all input events (at least all synthetic ones) from the input queue, to ensure it sees the current state. Fortunately the parent commit makes it so if we separate them bind foo "commandline -f expand-abbr" "commandline -i \n" both will be separate events and the commandline state will be synced after each of them. This fixes abbreviation expansion here. Also, we can now mix readline cmds and shell commands, which makes it shorter. |
||
---|---|---|
.. | ||
completions | ||
functions | ||
groff | ||
tools | ||
__fish_build_paths.fish.in | ||
config.fish |