aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/dirh.fish
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-05-04 18:37:24 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-05-04 18:37:24 -0700
commit007c5bc9f0c0d997b9fecb6f7d429a38458de407 (patch)
tree04057bae83d6d476cb8a8d49f895cb803fa169ef /share/functions/dirh.fish
parent8c423b56dfb29b905f2b74735a2d18478200e5cd (diff)
Workaround difference between BSD and GNU seq in dirh
dirh still doesn't make any sense
Diffstat (limited to 'share/functions/dirh.fish')
-rw-r--r--share/functions/dirh.fish11
1 files changed, 7 insertions, 4 deletions
diff --git a/share/functions/dirh.fish b/share/functions/dirh.fish
index 58201767..b9b86b56 100644
--- a/share/functions/dirh.fish
+++ b/share/functions/dirh.fish
@@ -25,10 +25,13 @@ function dirh --description "Print the current directory history (the back- and
set_color $fish_color_history_current
echo -n -e $current$separator
set_color normal
-
- for i in (seq (echo (count $dirnext)) -1 1)
- echo -n -e $dirnext[$i]$separator
- end
+
+ # BSD seq 0 outputs '1 0' instead of nothing
+ if test (count $dirnext) -gt 0
+ for i in (seq (echo (count $dirnext)) -1 1)
+ echo -n -e $dirnext[$i]$separator
+ end
+ end
echo
end