repl: fix {name} pattern to accept underscores (#10 follow-up)

%w excludes underscore in Lua patterns, so {ctx_used}, {ctx_max},
{cwd_short}, {last_status} were left literal in the prompt. Use
[%w_] to accept identifiers with underscores.

Surfaced during higgs smoke test of the new template.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-16 21:14:57 +00:00
parent d738f339cb
commit ce1378edee
+1 -1
View File
@@ -481,7 +481,7 @@ function M.run(config)
last_status = last_exec_code and tostring(last_exec_code) or "",
mode = _mode(),
}
return (tmpl:gsub("{(%w+)}", function(k) return vars[k] or "" end))
return (tmpl:gsub("{([%w_]+)}", function(k) return vars[k] or "" end))
end
if ctx.norris_active then
return ("[aish:%s \xE2\x9A\xA1]> "):format(active_name)