Skip to content

Conversation

@deansheather
Copy link
Member

Resolved an invalid parameter error (-2147024809) during PTY creation on Windows 11 22H2 (but not only) when connecting via JetBrains Toolbox which spawns the native SSH client with -tt forcing PTY allocation even though there is no "terminal" on the client side to query its size.

CreatePseudoConsole doesn't accept a 0x0 (zero width and zero height) console size and unfortunately, there is NO explicit documentation in the official Microsoft documentation that states the minimum valid values or explicitly prohibits 0x0.

Looking at real-world implementations in the search results, all examples use reasonable non-zero values.

I tested this with a local Windows VM registered to dev.coder.com i.e. externally managed workspace.

Relates to #20468

…0472)

Resolved an invalid parameter error (-2147024809) during PTY creation on
Windows 11 22H2 (but not only) when connecting via JetBrains Toolbox
which spawns the native SSH client with `-tt` forcing PTY allocation
even though there is no "terminal" on the client side to query its size.

CreatePseudoConsole doesn't accept a 0x0 (zero width and zero height)
console size and unfortunately, there is NO explicit documentation in
the official Microsoft documentation that states the minimum valid
values or explicitly prohibits 0x0.

Looking at real-world implementations in the search results, all
examples use reasonable non-zero values.

I tested this with a local Windows VM registered to dev.coder.com i.e.
externally managed workspace.

Fixes: #20468
(cherry picked from commit b890930)
@deansheather deansheather merged commit 035ad33 into release/2.27 Oct 28, 2025
26 of 27 checks passed
@deansheather deansheather deleted the dean/backport-win-pty-fix-2.27 branch October 28, 2025 11:47
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants