Operating system
macOS
Netcatty version
1.1.82
How did you install Netcatty?
GitHub Release (.dmg / .exe / .AppImage / .deb / .rpm / .pacman)
Affected area
SSH connection / terminal; AI assistant
Can you reproduce it?
Always (100%)
Steps to reproduce
- On macOS, connect Netcatty 1.1.82 to a Windows OpenSSH host whose registry
DefaultShell is unset (so the login shell is cmd.exe).
- Configure the host startup command to launch
pwsh.exe -NoLogo. Wait for the default PS C:\\...> prompt. The reproduced host used Windows OpenSSH 9.5.6.1 and PowerShell 7.6.5.
- Attach External MCP to that already-open terminal session.
- Call
terminal_execute with Write-Output 'PROBE_1'.
- Call
terminal_execute again with Write-Output 'PROBE_2'.
Expected behavior
Both commands should execute with the PowerShell wrapper, return only their requested output, and leave the interactive SSH tab connected at a clean PowerShell prompt.
Actual behavior
The first call prints PROBE_1 and reports exit code 0, but also emits a CommandNotFoundException for an empty command. The second call falls back to the cmd.exe wrapper even though the live shell is still PowerShell. PowerShell enters the >> continuation prompt, reports Missing closing ')' in expression, and terminal_execute times out after 60 seconds with exit code -1. The terminal tab then disappears from the External MCP scope.
This is a remaining case after #2959/#2960: the probed login-shell hint is cmd, while a host startup command moves the interactive PTY into PowerShell.
Isolation results:
- Typing the current PowerShell wrapper body directly in the same terminal succeeds without the extra error.
- Sending the current PowerShell pending-input clear sequence (
Escape, Ctrl+U, Ctrl+K) before a simple command reproduces the empty-command error. On this PSReadLine configuration the control keys are not a safe universal line-clear sequence.
- Ordinary UI-entered PowerShell commands work, so the SSH transport and PowerShell session are healthy outside MCP injection.
Logs / screenshots
Redacted External MCP output from the second call:
... set "SYSTEMD_PAGER=" ... call cmd /d /s /c ...
>>
ParserError:
Missing closing ')' in expression.
PS C:\\Users\\redacted>
>>
[exit code: -1]
[error] Command timed out (60s)
Relevant current code:
electron/bridges/ai/ptyExecHelpers.cjs: buildPendingInputClearPrefix("powershell") returns Escape + Ctrl+U + Ctrl+K.
electron/bridges/ai/ptyExec.cjs: startPtyJob prepends that sequence even when expectedPrompt already proves a clean idle prompt.
Before submitting
Operating system
macOS
Netcatty version
1.1.82
How did you install Netcatty?
GitHub Release (.dmg / .exe / .AppImage / .deb / .rpm / .pacman)
Affected area
SSH connection / terminal; AI assistant
Can you reproduce it?
Always (100%)
Steps to reproduce
DefaultShellis unset (so the login shell is cmd.exe).pwsh.exe -NoLogo. Wait for the defaultPS C:\\...>prompt. The reproduced host used Windows OpenSSH 9.5.6.1 and PowerShell 7.6.5.terminal_executewithWrite-Output 'PROBE_1'.terminal_executeagain withWrite-Output 'PROBE_2'.Expected behavior
Both commands should execute with the PowerShell wrapper, return only their requested output, and leave the interactive SSH tab connected at a clean PowerShell prompt.
Actual behavior
The first call prints
PROBE_1and reports exit code 0, but also emits aCommandNotFoundExceptionfor an empty command. The second call falls back to the cmd.exe wrapper even though the live shell is still PowerShell. PowerShell enters the>>continuation prompt, reportsMissing closing ')' in expression, andterminal_executetimes out after 60 seconds with exit code -1. The terminal tab then disappears from the External MCP scope.This is a remaining case after #2959/#2960: the probed login-shell hint is cmd, while a host startup command moves the interactive PTY into PowerShell.
Isolation results:
Escape,Ctrl+U,Ctrl+K) before a simple command reproduces the empty-command error. On this PSReadLine configuration the control keys are not a safe universal line-clear sequence.Logs / screenshots
Redacted External MCP output from the second call:
Relevant current code:
electron/bridges/ai/ptyExecHelpers.cjs:buildPendingInputClearPrefix("powershell")returnsEscape + Ctrl+U + Ctrl+K.electron/bridges/ai/ptyExec.cjs:startPtyJobprepends that sequence even whenexpectedPromptalready proves a clean idle prompt.Before submitting