Prepend command to cat

*Problem:*
edit_command_buffer uses `cat` to return the modified content.
If a person has an alias for `cat` to a different command such `bat`** the editing will not be useful anymore since bat decorates the text with frames, line counts, etc

*Solution*
Appending command to cat, fish will ignore the alias and execute the real command according to this https://fishshell.com/docs/current/cmds/command.html

** https://github.com/sharkdp/bat
This commit is contained in:
Victor Diaz 2021-09-12 14:42:16 +02:00 committed by David Adam
parent 29413665c5
commit 8c09fc7a3a

View File

@ -70,7 +70,7 @@ function edit_command_buffer --description 'Edit the command buffer in an extern
if test $editor_status -eq 0 -a -s $f
# Set the command to the output of the edited command and move the cursor to the
# end of the edited command.
commandline -r -- (cat $f)
commandline -r -- (command cat $f)
commandline -C 999999
else
echo