You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(parsing): add EscapeLiteral mode to opt out of shell backslash escaping
By default the console splits input with POSIX shell semantics, so an
unquoted backslash escapes the next character. This mangles values that
carry literal backslashes (e.g. Windows paths: `C:\Windows\Temp` becomes
`C:WindowsTemp`) and makes a trailing backslash request a continuation
line, which is surprising when the console is used as a general Cobra
frontend rather than a shell.
Introduce a console-wide EscapeMode with two values:
- EscapeShell (default): unchanged POSIX escape behavior.
- EscapeLiteral: backslashes are ordinary characters; quotes still
group words, `C:\Windows\Temp` is passed through verbatim, and a
trailing backslash no longer requests another line.
Select it with Console.SetEscapeMode(console.EscapeLiteral). The mode is
threaded through all three shell-word splitters so command execution,
multiline-continuation detection, and completion/highlighting stay
consistent. The EscapeShell path is byte-for-byte unchanged.
Closes#88.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments