summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Murase <myoga.murase@gmail.com>2025-06-04 13:20:54 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-06-08 00:00:17 +0900
commit243e52fa1142c5e8f6909b89367c07a94e00bbe8 (patch)
tree2e259fe2805b839601dd463d1790412f9215881b
parentc166eaba6d5e74d39a68c45804a01417d707a304 (diff)
downloadfzf-243e52fa1142c5e8f6909b89367c07a94e00bbe8.tar.gz
[bash,zsh] Work around mawk 1.3.3-20090705 not supporting the POSIX brackets
-rw-r--r--shell/completion.bash5
-rw-r--r--shell/completion.zsh5
2 files changed, 8 insertions, 2 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index 3589580a..2132ffd1 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -529,7 +529,10 @@ if ! declare -F __fzf_list_hosts > /dev/null; then
) \
<(
__fzf_exec_awk '
- /^[[:blank:]]*(#|$)|0\.0\.0\.0/ { next }
+ # Note: mawk <= 1.3.3-20090705 does not support the POSIX brackets of
+ # the form [[:blank:]], and Ubuntu 18.04 LTS still uses this
+ # 16-year-old mawk unfortunately. We need to use [ \t] instead.
+ /^[ \t]*(#|$)|0\.0\.0\.0/ { next }
{
sub(/#.*/, "")
for (i = 2; i <= NF; i++)
diff --git a/shell/completion.zsh b/shell/completion.zsh
index 7f4a8112..d5406880 100644
--- a/shell/completion.zsh
+++ b/shell/completion.zsh
@@ -307,7 +307,10 @@ if ! declare -f __fzf_list_hosts > /dev/null; then
) \
<(
__fzf_exec_awk '
- /^[[:blank:]]*(#|$)|0\.0\.0\.0/ { next }
+ # Note: mawk <= 1.3.3-20090705 does not support the POSIX brackets of
+ # the form [[:blank:]], and Ubuntu 18.04 LTS still uses this
+ # 16-year-old mawk unfortunately. We need to use [ \t] instead.
+ /^[ \t]*(#|$)|0\.0\.0\.0/ { next }
{
sub(/#.*/, "")
for (i = 2; i <= NF; i++)