diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index 67071931..1b6dcf2a 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -57,11 +57,11 @@ if [[ $- =~ i ]]; then last_hist=$(HISTTIMEFORMAT='' builtin history 1) awk -v last_hist="$last_hist" -v c_idx="$c_idx" -v c_reset="$c_reset" ' BEGIN { HISTCMD = last_hist + 1; cmd = ""; idx = 0 } /^\t/ { - if (cmd != "" && !seen[cmd]++) printf "%s%d%s\t%s\0", c_idx, HISTCMD - idx, c_reset, cmd + if (cmd != "" && !seen[cmd]++) printf "%s%d%s\t%s%c", c_idx, HISTCMD - idx, c_reset, cmd, 0 idx++; cmd = substr($0, 2); sub(/^[ *]/, "", cmd); next } { cmd = cmd "\n" $0 } - END { if (cmd != "" && !seen[cmd]++) printf "%s%d%s\t%s\0", c_idx, HISTCMD - idx, c_reset, cmd } + END { if (cmd != "" && !seen[cmd]++) printf "%s%d%s\t%s%c", c_idx, HISTCMD - idx, c_reset, cmd, 0 } ' | SKIM_DEFAULT_OPTIONS="$SKIM_DEFAULT_OPTIONS -n2.. --bind=ctrl-r:toggle-sort $SKIM_CTRL_R_OPTS --no-multi --read0 $ansi_opt" $(__skimcmd) --query "$READLINE_LINE" ) || return