From 9c96a80f8b11ecb6c37a529ed675d7fe173f92c8 Mon Sep 17 00:00:00 2001 From: Anund Date: Sat, 21 Dec 2024 14:07:52 +1100 Subject: [PATCH] bash: document COMP_WORDBREAKS interaction --- src/build/bash_completions.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/build/bash_completions.zig b/src/build/bash_completions.zig index e8b6a254c..06d42e70e 100644 --- a/src/build/bash_completions.zig +++ b/src/build/bash_completions.zig @@ -37,7 +37,6 @@ fn writeBashCompletions(writer: anytype) !void { const pad4 = pad3 ++ pad1; try writer.writeAll( - \\ \\# -o nospace requires we add back a space when a completion is finished \\# and not part of a --key= completion \\addSpaces() { @@ -281,6 +280,11 @@ fn writeBashCompletions(writer: anytype) !void { \\ cur=""; prev=""; prevWasEq=false; COMPREPLY=() \\ ghostty="$1" \\ + \\ # script assumes default COMP_WORDBREAKS of roughly $' \t\n"\'><=;|&(:' + \\ # if = is missing this script will degrade to matching on keys only. + \\ # eg: --key= + \\ # this can be improved if needed see: https://github.com/ghostty-org/ghostty/discussions/2994 + \\ \\ if [ "$2" = "=" ]; then cur="" \\ else cur="$2" \\ fi