PSEUDOCONSOLE_INHERIT_CURSOR sends DSR CPR to terminal, if the process is closed before a response is received, conhost will max out a core #15195

Closed
opened 2026-01-31 04:31:09 +00:00 by claunia · 2 comments
Owner

Originally created by @Tyriar on GitHub (Sep 13, 2021).

Windows Terminal version (or Windows build number)

19042.1165

Other Software

VS Code/node-pty based on main

Steps to reproduce

  1. Use PSEUDOCONSOLE_INHERIT_CURSOR to when using conpty
  2. Don't respond to CSI 6 n in terminal
  3. Close the terminal program

Expected Behavior

Conpty should handle this more gracefully, perhaps a timeout should be used when the CPR response isn't received and continue on ignoring PSEUDOCONSOLE_INHERIT_CURSOR ?

Actual Behavior

The conhost process maxes out a CPU core


FWIW I worked around the issue by making sure a terminal is available to respond to the sequence on Windows (I'm in the process of building terminal buffer restoration/process revive after restarts).

Originally created by @Tyriar on GitHub (Sep 13, 2021). ### Windows Terminal version (or Windows build number) 19042.1165 ### Other Software VS Code/node-pty based on `main` ### Steps to reproduce 1. Use PSEUDOCONSOLE_INHERIT_CURSOR to when using conpty 2. Don't respond to CSI 6 n in terminal 3. Close the terminal program ### Expected Behavior Conpty should handle this more gracefully, perhaps a timeout should be used when the CPR response isn't received and continue on ignoring PSEUDOCONSOLE_INHERIT_CURSOR ? ### Actual Behavior The conhost process maxes out a CPU core --- FWIW I worked around the issue by making sure a terminal is available to respond to the sequence on Windows (I'm in the process of building terminal buffer restoration/process revive after restarts).
claunia added the Issue-BugIn-PRNeeds-Tag-FixArea-ServerProduct-ConptyPriority-1 labels 2026-01-31 04:31:10 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Sep 13, 2021):

Conpty should handle this more gracefully, perhaps a timeout should be used when the CPR response isn't received and continue on ignoring PSEUDOCONSOLE_INHERIT_CURSOR ?

Alternatively, since the end terminal's closed, then presumably the conpty is getting closed, yea? It should probably close gracefully even in this case.

@zadjii-msft commented on GitHub (Sep 13, 2021): > Conpty should handle this more gracefully, perhaps a timeout should be used when the CPR response isn't received and continue on ignoring PSEUDOCONSOLE_INHERIT_CURSOR ? Alternatively, since the end terminal's closed, then presumably the conpty is getting closed, yea? It should probably close gracefully even in this case.
Author
Owner

@zadjii-msft commented on GitHub (Sep 20, 2021):

@miniksa fyi, you're in this bit of the code recently. You may want to be aware of this

@zadjii-msft commented on GitHub (Sep 20, 2021): @miniksa fyi, you're in this bit of the code recently. You may want to be aware of this
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15195