oh-my-fish / plugin-foreign-env

Run foreign bash scripts and capture exported environment variables
MIT License
221 stars 15 forks source link

fish: Unknown command 'less -R' #22

Open toonn opened 5 years ago

toonn commented 5 years ago

There seems to be a problem in parsing of env vars like PAGER. We noticed when running history that fish errored on the pager, you can find all the details in fish-shell/fish-shell#5994, reproduced in part here for convenience:

toonn@terra ~> history
fish: Unknown command 'less -R'
/nix/store/m8j4gqqkdy3nm0v738kjivimnlqkdqpx-fish-3.0.2/share/fish/functions/history.fish (line 99): 
                builtin history search $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv | $pager
                                                                                                                                      ^
in function 'history'
    called on standard input

toonn@terra ~> set PAGER less
toonn@terra ~> echo $PAGER
less
toonn@terra ~> history
echo $PAGER
set PAGER less
env PAGER=less history # <- this didn't work because history's a function probably

@adisbladis tracked this down to the fenv call here.