File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -125,11 +125,6 @@ k () {
125125 K_COLOR_OW=$( _k_bsd_to_ansi $LSCOLORS [21] $LSCOLORS [22])
126126 fi
127127
128- # read colors if linux and $LS_COLORS is defined
129- # if [[ $(uname) == 'Linux' && -n $LS_COLORS ]]; then
130-
131- # fi
132-
133128 # ----------------------------------------------------------------------------
134129 # Loop over passed directories and files to display
135130 # ----------------------------------------------------------------------------
@@ -476,7 +471,12 @@ k () {
476471 # But we don't want to quote '.'; so instead we escape the escape manually and use q-
477472 NAME=" ${${NAME##*/ } // $' \e ' / \\ e} " # also propagate changes to SYMLINK_TARGET below
478473
479- if [[ $IS_DIRECTORY == 1 ]]; then
474+ if [[ " $LS_COLORS " ]] && ls --color -d . & > /dev/null; then
475+ # We are using an ls that supports using colors from $LS_COLORS (probably GNU ls here)
476+ pushd " ${base_dir} " & > /dev/null
477+ NAME=" $( ls --color=always -d " $NAME " ) "
478+ popd & > /dev/null
479+ elif [[ $IS_DIRECTORY == 1 ]]; then
480480 if [[ $IS_WRITABLE_BY_OTHERS == 1 ]]; then
481481 if [[ $HAS_STICKY_BIT == 1 ]]; then
482482 NAME=$' \e [' " $K_COLOR_TW " ' m' " $NAME " $' \e [0m' ;
You can’t perform that action at this time.
0 commit comments