Summary
On Unix Sliver clients, interactive shells for Windows targets run without a remote PTY. In that code path the local terminal remains in canonical mode, so Ctrl-] is echoed as ^] and buffered until Enter is pressed. The client still displays Escape: press Ctrl-], which suggests immediate detachment.
Reproduction
- Connect to a Windows session from a Linux/Kali Sliver client.
- Run
shell.
- Press
Ctrl-].
- Observe
^] at the PowerShell prompt and no detach.
- Press Enter; the shell then detaches.
A standalone raw-input test confirms the terminal emits byte 0x1d correctly.
Root cause
Windows targets force noPty = true. runInteractive calls term.MakeRaw(0) only when enablePTY is true. Therefore local stdin stays canonical for Windows/no-PTY shells, while runAttachedIO expects to receive byte 0x1d immediately.
Suggested fix
Decouple local escape-key handling from remote PTY support. For Unix no-PTY shells, configure Ctrl-] as a temporary canonical EOL character (VEOL), or otherwise arrange immediate local escape detection while preserving canonical echo/editing. Restore the original terminal state on detach and exit.
A minimal fallback would be to change the displayed instruction for no-PTY shells to press Ctrl-], then Enter.
Summary
On Unix Sliver clients, interactive shells for Windows targets run without a remote PTY. In that code path the local terminal remains in canonical mode, so
Ctrl-]is echoed as^]and buffered until Enter is pressed. The client still displaysEscape: press Ctrl-], which suggests immediate detachment.Reproduction
shell.Ctrl-].^]at the PowerShell prompt and no detach.A standalone raw-input test confirms the terminal emits byte
0x1dcorrectly.Root cause
Windows targets force
noPty = true.runInteractivecallsterm.MakeRaw(0)only whenenablePTYis true. Therefore local stdin stays canonical for Windows/no-PTY shells, whilerunAttachedIOexpects to receive byte0x1dimmediately.Suggested fix
Decouple local escape-key handling from remote PTY support. For Unix no-PTY shells, configure
Ctrl-]as a temporary canonical EOL character (VEOL), or otherwise arrange immediate local escape detection while preserving canonical echo/editing. Restore the original terminal state on detach and exit.A minimal fallback would be to change the displayed instruction for no-PTY shells to
press Ctrl-], then Enter.