Skip to content

Commit 262e9a0

Browse files
committed
fix zsh
1 parent 2f5e4c7 commit 262e9a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cdhist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ function _menuprompt
428428

429429
function _showmenu
430430
{
431-
typeset prompt="$1" nsel="$2" nbitems="$3" filter="$4" item i min max sel lines icon path
431+
typeset prompt="$1" nsel="$2" nbitems="$3" filter="$4" item i min max sel lines icon fpath
432432

433433
_menuprompt "$prompt" "$nbitems" "$filter"
434434
w=$nbitems;w=${#w}
@@ -448,9 +448,9 @@ function _showmenu
448448
[[ $i -le $max ]] || break
449449
icon=''
450450
[ "$_sel_option" = filenames ] && {
451-
[[ "$item" = \~/* ]] && path="$HOME/"${item#\~/} || path="$item"
452-
if [ -d "$path" ] ;then icon="$SELECTOR_FOLDER_ICON "
453-
else [ -e "$path" -o -L "$path" ] && icon="$SELECTOR_FILE_ICON ";fi
451+
[[ "$item" = \~/* ]] && fpath="$HOME/"${item#\~/} || fpath="$item"
452+
if [ -d "$fpath" ] ;then icon="$SELECTOR_FOLDER_ICON "
453+
else [ -e "$fpath" -o -L "$fpath" ] && icon="$SELECTOR_FILE_ICON ";fi
454454
}
455455
if [[ $nsel == "$i" ]]; then
456456
printf "$sel" $i "$icon$item"
@@ -495,7 +495,7 @@ function _items_split
495495
_nsel=1
496496
IFS=$'\n'
497497
# ZSH array index starts at 1
498-
[ "$ZSH_VERSION" ] && _aitems=( $_items ) || { _aitems=( _ $_items ); unset '_aitems[0]'; }
498+
[ "$ZSH_VERSION" ] && _aitems=( $(printf %s "$_items") ) || { _aitems=( _ $_items ); unset '_aitems[0]'; }
499499
IFS=$' \t\n'
500500
}
501501

0 commit comments

Comments
 (0)