Skip to content

Commit

Permalink
[fish] Remove perl from fish key bindings (junegunn#1635)
Browse files Browse the repository at this point in the history
Perl was used to remove the trailing newline character, but fzf already
has --print0 to use null character as terminators, and fish read -z is
expecting null character as terminators. There is no reason to depend on
perl if --print0 is passed to fzf invocation.
  • Loading branch information
ssjhv authored and junegunn committed Jul 13, 2019
1 parent c1dbc80 commit e7097a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shell/key-bindings.fish
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function fzf_key_bindings
# history's -z flag was added in fish 2.4.0, so don't use it for versions
# before 2.4.0.
if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ];
history -z | eval (__fzfcmd) --read0 -q '(commandline)' | perl -pe 'chomp if eof' | read -lz result
history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result
and commandline -- $result
else
history | eval (__fzfcmd) -q '(commandline)' | read -l result
Expand Down

0 comments on commit e7097a9

Please sign in to comment.