From ba2fcd9dae9ed03ce78e757891b3ad3fb3526c1d Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sun, 3 Nov 2013 13:19:28 +0100 Subject: [PATCH] Use basename for man argument This protects from providing paths to man, like `./a.out`. --- share/functions/fish_default_key_bindings.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index 7121db388..b22d76967 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -100,7 +100,7 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis bind \cd delete-or-exit # 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 bind \ep '__fish_paginate'