Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] fix _gdb some options not being skipped
- X-seq: zsh-workers 55222
- From: tiandic <2323748675@xxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: tiandic <2323748675@xxxxxx>
- Subject: [PATCH] fix _gdb some options not being skipped
- Date: Mon, 19 Oct 2026 12:33:20 +0800
- Archived-at: <https://zsh.org/workers/55222>
- List-id: <zsh-workers.zsh.org>
Some parameters not being skipped can cause the variable 'w' to be set incorrectly.
For example: `gdb -p 1234 <TAB>` can cause the value of 'w[1]' to be '1234', which leads to completion errors.
The skip list in this commit is based on the latest gdb commit: 8f7fb583, getting long_options[] from gdb/main.c to make sure all valid options are skipped.
---
Completion/Unix/Command/_gdb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Completion/Unix/Command/_gdb b/Completion/Unix/Command/_gdb
index 051812325..8117b5793 100644
--- a/Completion/Unix/Command/_gdb
+++ b/Completion/Unix/Command/_gdb
@@ -42,7 +42,7 @@ else
w=( "${(@)words[2,CURRENT-1]}" )
while [[ "$w[1]" = -* ]]; do
- [[ "$w[1]" = -(cd|se|tty|[decsxb]) ]] && shift 1 w
+ [[ "$w[1]" = -([bcdeilpsxD]|cd|ex|ix|se|ui|eix|iex|pid|tty|baud|core|eiex|exec|command|symbols|annotate|directory|tclcommand|interpreter|eval-command|init-command|data-directory|editor-command|init-eval-command|early-init-command|early-init-eval-command) ]] && shift 1 w
(( $#w )) && shift 1 w
done
--
2.56.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author