Use basename for man argument

This protects from providing paths to man, like `./a.out`.
This commit is contained in:
Konrad Borowski 2013-11-03 13:19:28 +01:00 committed by David Adam
parent c0ad54fe02
commit ba2fcd9dae

View file

@ -100,7 +100,7 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind \cd delete-or-exit bind \cd delete-or-exit
# Allow reading manpages by pressing F1 # Allow reading manpages by pressing F1
bind -k f1 'man (commandline -po; echo)[1] ^/dev/null; or echo -n \a' bind -k f1 'man (basename (commandline -po; echo))[1] ^/dev/null; or echo -n \a'
# This will make sure the output of the current command is paged using the less pager when you press Meta-p # This will make sure the output of the current command is paged using the less pager when you press Meta-p
bind \ep '__fish_paginate' bind \ep '__fish_paginate'