mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 04:51:16 -03:00
dirh: Don't rely on negative increments in seq
Not available in BSD seq. Fixes #3354.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user