diff options
| author | Brad Kollmyer <bradk@vitalsoft.com> | 2026-07-10 17:20:13 -0700 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2026-09-24 10:21:55 -0500 |
| commit | 1ec6e664afc29957d9f3f596fd4433b4ebb1f7a7 (patch) | |
| tree | f7787b76094dd679d85c173a2409f307de1243e5 /python | |
| parent | ed218c254d964775ddf24158ac6520972d575faf (diff) | |
| download | vyos-1x-1ec6e664afc29957d9f3f596fd4433b4ebb1f7a7.tar.gz vyos-1x-1ec6e664afc29957d9f3f596fd4433b4ebb1f7a7.zip | |
cli: T9077: insert literal '?' inside quoted values instead of triggering help
The '?' key is a raw readline binding (possible-completions), so a
literal question mark can never be typed into a value: readline
intercepts the keystroke before bash parsing begins and quoting cannot
protect it. Values like remote-group URLs with query strings get
silently corrupted ('.../blacklist?key=x' is stored as
'.../blacklistkey=x') with no error at any stage.
Rebind '?' to a bind -x handler that scans the line left of the cursor
for an open single/double quote or a pending backslash escape. Inside a
quote or escape the key self-inserts; otherwise it triggers the
standard help via a DSR round-trip (printf '\e[5n' with the terminal's
reply ESC [ 0 n bound to possible-completions), keeping the help path
and output identical to the previous behavior.
'set terminal key query-help enable' now restores the quote-aware
handler instead of the raw binding; 'disable' keeps its existing
self-insert override, which takes precedence at login as before.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'python')
0 files changed, 0 insertions, 0 deletions
