fish-shell/share/functions/dirs.fish
ridiculousfish b823b91bcd Remove an errant newline from the dirs function
The dirs function prints an extra newline; it is not obvious why this is
needed but it has been this way forever. Let's remove it.
2021-05-04 13:32:21 -07:00

20 lines
451 B
Fish

function dirs --description 'Print directory stack'
set -l options h/help c
argparse -n dirs --max-args=0 $options -- $argv
or return
if set -q _flag_help
__fish_print_help dirs
return 0
end
if set -q _flag_c
# Clear directory stack.
set -e -g dirstack
return 0
end
# Replace $HOME with ~.
string replace -r '^'"$HOME"'($|/)' '~$1' -- $PWD $dirstack | string join " "
end