From 17aeef886c003dcbae7fab602cf08e7527ec483f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Sat, 30 May 2026 20:11:03 +0200 Subject: [PATCH] terminal: show ghost text hints for /help arguments --- src/agent/Terminal.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agent/Terminal.zig b/src/agent/Terminal.zig index 4b026333..57b90543 100644 --- a/src/agent/Terminal.zig +++ b/src/agent/Terminal.zig @@ -354,7 +354,7 @@ fn completionCallback(cenv: ?*c.ic_completion_env_t, prefix: [*c]const u8) callc var buf: [completion_buf_len:0]u8 = undefined; - // `/help `: arg is a tool name, not a value — skip env-var fallthrough. + // `/help `: arg is a command name, not a value — skip env-var fallthrough. if (parseHelpArgPrefix(input)) |partial| { for (all_slash_names) |name| addPrefixedCompletion(cenv, &buf, input, help_arg_prefix, name, "", partial); return; @@ -401,8 +401,8 @@ fn hintsCallback(input_c: [*c]const u8, arg: ?*anyopaque) callconv(.c) [*c]const const input = std.mem.sliceTo(@as([*:0]const u8, @ptrCast(input_c)), 0); if (input.len == 0) return null; - // `/help `: leave the inline hint to the completion-derived path. - if (parseHelpArgPrefix(input)) |_| return null; + // `/help `: ghost the first command name that matches the arg. + if (parseHelpArgPrefix(input)) |partial| return ghostFirstMatch(all_slash_names, partial, ""); // Inside an open `'''…'''` body the buffer is script text, not kv args. if (Schema.hasUnclosedTripleQuote(input)) return null;