Skip to content

fix: initialize pseudo console with default size for SSH sessions#20472

Merged
deansheather merged 3 commits into
mainfrom
fix-default-pty-buffer-size-on-wind
Oct 25, 2025
Merged

fix: initialize pseudo console with default size for SSH sessions#20472
deansheather merged 3 commits into
mainfrom
fix-default-pty-buffer-size-on-wind

Conversation

@fioan89

@fioan89 fioan89 commented Oct 24, 2025

Copy link
Copy Markdown
Collaborator

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

Resolved an invalid parameter error (-2147024809) during PTY creation on
Windows 11 22H2 (but not only) when connecting via JetBrains Toolbox.
CreatePseudoConsole doesn't accept a 0x0 (zero width and zero height)
console size. Toolbox uses the default native client which apparently
sends the width and height set to 0 in ssh req opts.

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
@github-actions

github-actions Bot commented Oct 24, 2025

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@fioan89 fioan89 changed the title fix: pseudo console initialization for SSH sessions fix: initialize pseudo console with default size for SSH sessions Oct 24, 2025
@fioan89

fioan89 commented Oct 24, 2025

Copy link
Copy Markdown
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

cdrci2 added a commit to coder/cla that referenced this pull request Oct 24, 2025
@deansheather deansheather merged commit b890930 into main Oct 25, 2025
25 checks passed
@deansheather deansheather deleted the fix-default-pty-buffer-size-on-wind branch October 25, 2025 03:05
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 25, 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.

bug: JetBrains Toolbox fails to connect to Windows VM – PTY creation error (-2147024809)

2 participants