diff options
author | kissge <kissge@users.noreply.github.com> | 2022-08-02 20:56:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-02 20:56:25 +0900 |
commit | 475469a2e7131c6917f8b46a4d2bdf0c02ca4a21 (patch) | |
tree | 12253a953ff32ae63aa33271a1fbda0092c65832 /shell | |
parent | 3a7447dcb6295e914889422be418d0ec2eaf5fe1 (diff) |
[zsh] Make awk regex compatible with both GNU and macOS (#2906)
Diffstat (limited to 'shell')
-rw-r--r-- | shell/key-bindings.zsh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index 88a9a9e7..b0b81f26 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -97,7 +97,7 @@ bindkey -M viins '\ec' fzf-cd-widget fzf-history-widget() { local selected num setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null - selected=( $(fc -rl 1 | awk '{ cmd=$0; sub(/^\s*[0-9]+\**\s+/, "", cmd); if (!seen[cmd]++) print $0 }' | + selected=( $(fc -rl 1 | awk '{ cmd=$0; sub(/^[ \t]*[0-9]+\**[ \t]+/, "", cmd); if (!seen[cmd]++) print $0 }' | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) ) local ret=$? if [ -n "$selected" ]; then |