Terminal capability queries sometimes duplicated over SSH #23885

Closed
opened 2026-01-31 08:55:07 +00:00 by claunia · 3 comments
Owner

Originally created by @8LWXpg on GitHub (Dec 18, 2025).

Windows Terminal version

1.23.13503.0

Windows build number

10.0.26200.0

Other Software

OpenSSH_for_Windows_10.0p2 Win32-OpenSSH-GitHub, LibreSSL 4.2.0

Steps to reproduce

From https://github.com/sxyazi/yazi/issues/3440

ssh into remote linux host

echo -e -n '\x1b[?1049h\x1bP$q q\x1b\\\x1b[?12$p\x1b[?u\x1b[0c'; cat

Expected Behavior

No response

Actual Behavior

Sometimes got duplicate result

^[P1$r6 q^[\^[[?12;2$y^[[?61;4;6;7;14;21;22;23;24;28;32;42;52c^[P1$r6 q^[\^[[?12;2$y^[[?61;4;6;7;14;21;22;23;24;28;32;42;52c
Originally created by @8LWXpg on GitHub (Dec 18, 2025). ### Windows Terminal version 1.23.13503.0 ### Windows build number 10.0.26200.0 ### Other Software OpenSSH_for_Windows_10.0p2 Win32-OpenSSH-GitHub, LibreSSL 4.2.0 ### Steps to reproduce From https://github.com/sxyazi/yazi/issues/3440 ssh into remote linux host ``` echo -e -n '\x1b[?1049h\x1bP$q q\x1b\\\x1b[?12$p\x1b[?u\x1b[0c'; cat ``` ### Expected Behavior _No response_ ### Actual Behavior Sometimes got duplicate result ``` ^[P1$r6 q^[\^[[?12;2$y^[[?61;4;6;7;14;21;22;23;24;28;32;42;52c^[P1$r6 q^[\^[[?12;2$y^[[?61;4;6;7;14;21;22;23;24;28;32;42;52c ```
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 08:55:07 +00:00
Author
Owner

@DHowett commented on GitHub (Dec 18, 2025):

Thanks for the report! This is actually a bug in Win32-OpenSSH, which was fixed in https://github.com/PowerShell/openssh-portable/pull/806. In short, when the SSH client processes a SIGWINCH, it may erroneously resubmit a partial response buffer from a previous response.

This is triggered most often by combining DECSET 1049/ASB with any query, as some terminal emulators emit a window size change as they enter the alternate screen buffer.

@DHowett commented on GitHub (Dec 18, 2025): Thanks for the report! This is actually a bug in Win32-OpenSSH, which was fixed in https://github.com/PowerShell/openssh-portable/pull/806. In short, when the SSH client processes a `SIGWINCH`, it may erroneously resubmit a partial response buffer from a previous response. This is triggered most often by combining DECSET 1049/ASB with any query, as some terminal emulators emit a window size change as they enter the alternate screen buffer.
Author
Owner

@DHowett commented on GitHub (Dec 18, 2025):

(The version of Win32-OpenSSH with that fix should be available "soon", but I cannot speak to exactly when as the maintainers are not on my team. :))

@DHowett commented on GitHub (Dec 18, 2025): (The version of Win32-OpenSSH with that fix should be available "soon", but I cannot speak to exactly when as the maintainers are not on my team. :))
Author
Owner

@lhecker commented on GitHub (Dec 18, 2025):

I've built the latest version of ssh.exe earlier today. You may use it if you'd like: ssh_x64_f8cc7e7.zip
It is however important to mention that this is my personal version of ssh.exe. I expressly offer it with "no limit or warranty", as a lawyer would say. If that's not acceptable, the wiki has instructions for building it yourself.

@lhecker commented on GitHub (Dec 18, 2025): I've built the latest version of ssh.exe earlier today. You may use it if you'd like: [ssh_x64_f8cc7e7.zip](https://github.com/user-attachments/files/24243843/ssh_x64_f8cc7e7.zip) It is however important to mention that this is _my_ personal version of ssh.exe. I expressly offer it with "no limit or warranty", as a lawyer would say. If that's not acceptable, the wiki has instructions for building it yourself.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23885