mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
dirh: Don't rely on negative increments in seq
Not available in BSD seq. Fixes #3354.
This commit is contained in:
parent
578e4e8207
commit
f78f51e2a7
1 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,9 @@ function dirh --description "Print the current directory history (the prev and n
|
|||
|
||||
set -l dirc (count $dirprev)
|
||||
set -l dirprev_rev $dirprev[-1..1]
|
||||
for i in (seq $dirc -1 1)
|
||||
# This can't be (seq $dirc -1 1) because of BSD.
|
||||
set -l dirnum (seq 1 $dirc)
|
||||
for i in $dirnum[-1..1]
|
||||
printf '%2d) %s\n' $i $dirprev_rev[$i]
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue