Re-investigate Ctrl+S pausing #1105

Closed
opened 2026-01-30 22:16:39 +00:00 by claunia · 13 comments
Owner

Originally created by @miniksa on GitHub (May 15, 2019).

At some point in history, we broke Ctrl+S to pause the output in the console host. I think it was around the time that we messed with the ExtendedEditKeys stuff.

I don't have the full context on this anymore, this is just another note-to-self title only bug I had as MSFT: 17790922 that I'm porting to the outside.

We need to reinvestigate the state of Ctrl+S pausing throughout the ages. How did v1 do it? How did v2 do it over the releases of Windows 10? Do we need to reintroduce it as an option somehow?

Originally created by @miniksa on GitHub (May 15, 2019). At some point in history, we broke Ctrl+S to pause the output in the console host. I think it was around the time that we messed with the ExtendedEditKeys stuff. I don't have the full context on this anymore, this is just another note-to-self title only bug I had as MSFT: 17790922 that I'm porting to the outside. We need to reinvestigate the state of Ctrl+S pausing throughout the ages. How did v1 do it? How did v2 do it over the releases of Windows 10? Do we need to reintroduce it as an option somehow?
claunia added the Product-ConhostIssue-BugPriority-3In-PRArea-InputNeeds-Tag-Fix labels 2026-01-30 22:16:39 +00:00
Author
Owner

@oising commented on GitHub (May 15, 2019):

Ctrl+S / XOFF , ctrl+Q XON. It's just ye olde software flow control. Speaking for myself, I'd use it quite a lot with streaming logs, cat, tail etc. A vestige from old teleprinters / terminals and carried on in VT.

@oising commented on GitHub (May 15, 2019): Ctrl+S / XOFF , ctrl+Q XON. It's just ye olde software flow control. Speaking for myself, I'd use it quite a lot with streaming logs, cat, tail etc. A vestige from old teleprinters / terminals and carried on in VT.
Author
Owner

@oising commented on GitHub (May 15, 2019):

Oh, and yes, methinks you should definitely reintroduce it.

@oising commented on GitHub (May 15, 2019): Oh, and yes, methinks you should definitely reintroduce it.
Author
Owner

@eryksun commented on GitHub (May 16, 2019):

In NT 4, with line-input mode enabled, console output could be suspended either via the pause key (VK_PAUSE) or Ctrl-S. I'm certain Ctrl-S was chosen for the convenience of people accustomed to terminals. That said, pressing any key resumes output; it doesn't have to be Ctrl-Q since the console isn't actually a terminal responding to XOFF/XON.

Around Windows 2000 the "ExtendedEditKey" registry setting was added. If this was enabled, custom edit keys could be defined in "ExtendedEditkeyCustom". I don't think this was ever documented. If no custom mapping was defined, it used a default mapping that included the Ctrl-S -> VK_PAUSE mapping. So Ctrl-S still worked by default even if "ExtendedEditKey" was enabled.

The new console exposes "ExtendedEditKey" in the properties dialog, but it's repurposed now for "extended text selection keys". Since "ExtendedEditkeyCustom" no longer seems to be implemented beyond a vestigial CONSOLE_REGISTRY_EXTENDEDEDITKEY_CUSTOM macro in the source, I think IsPauseKey should simply return true for VK_PAUSE or Ctrl-S, which will restore the original behavior.

On a related note, in the source I see that "ExtendedEditKey" and the properties dialog set the value of global g_fEditKeys, but it seems to be unused.

@eryksun commented on GitHub (May 16, 2019): In NT 4, with line-input mode enabled, console output could be suspended either via the pause key (`VK_PAUSE`) or Ctrl-S. I'm certain Ctrl-S was chosen for the convenience of people accustomed to terminals. That said, pressing any key resumes output; it doesn't have to be Ctrl-Q since the console isn't actually a terminal responding to XOFF/XON. Around Windows 2000 the "ExtendedEditKey" registry setting was added. If this was enabled, custom edit keys could be defined in "ExtendedEditkeyCustom". I don't think this was ever documented. If no custom mapping was defined, it used a default mapping that included the Ctrl-S -> `VK_PAUSE` mapping. So Ctrl-S still worked by default even if "ExtendedEditKey" was enabled. The new console exposes "ExtendedEditKey" in the properties dialog, but it's repurposed now for "extended text selection keys". Since "ExtendedEditkeyCustom" no longer seems to be implemented beyond a vestigial `CONSOLE_REGISTRY_EXTENDEDEDITKEY_CUSTOM` macro in the source, I think [`IsPauseKey`](https://github.com/microsoft/terminal/blob/v0.1.1211.0/src/types/inc/IInputEvent.hpp#L210) should simply return true for `VK_PAUSE` or Ctrl-S, which will restore the original behavior. On a related note, in the source I see that "ExtendedEditKey" and the properties dialog set the value of global `g_fEditKeys`, but it seems to be unused.
Author
Owner

@floppytree commented on GitHub (Mar 5, 2021):

Do I understand it correctly that it's not only the keybinding that is missing but the whole feature of suspending the output? I would greatly appreciate the reintroduction of Ctrl-S. Sorry, if this is a developer-only forum and I'm intruding.

@floppytree commented on GitHub (Mar 5, 2021): Do I understand it correctly that it's not only the keybinding that is missing but the whole feature of suspending the output? I would greatly appreciate the reintroduction of Ctrl-S. Sorry, if this is a developer-only forum and I'm intruding.
Author
Owner

@HBelusca commented on GitHub (May 11, 2021):

Please fix, as this is very useful to temporarily pause the console when e.g. an operation quickly iterates over a large number of items and displays corresponding feedback, and one wants to pause to see things appearing every now and then.

@HBelusca commented on GitHub (May 11, 2021): Please fix, as this is very useful to temporarily pause the console when e.g. an operation quickly iterates over a large number of items and displays corresponding feedback, and one wants to pause to see things appearing every now and then.
Author
Owner

@KonstantinKhabarlak commented on GitHub (May 11, 2021):

I think it would be nice to have full feature like in linux: suspend, move to background, move to foreground

@KonstantinKhabarlak commented on GitHub (May 11, 2021): I think it would be nice to have full feature like in linux: suspend, move to background, move to foreground
Author
Owner

@oising commented on GitHub (May 12, 2021):

@KhabarlakKonstantin that is the responsibility of the shell (bash, cmd, pwsh, zsh), not the terminal (iterm2, xterm, windows terminal)

@oising commented on GitHub (May 12, 2021): @KhabarlakKonstantin that is the responsibility of the shell (bash, cmd, pwsh, zsh), not the terminal (iterm2, xterm, *windows terminal*)
Author
Owner

@smuuf commented on GitHub (Dec 20, 2021):

Btw. I'm on Windows Terminal Preview, Version: 1.12.3472.0 (Windows 11, Insiders Dev, 22523.1000) and Ctrl+S (pause), Ctrl+Q (unpause) seems to work correctly, just as was said here https://github.com/microsoft/terminal/issues/809#issuecomment-492462593.

Although I needed to use Google to find this exact comment to find out about this...

@smuuf commented on GitHub (Dec 20, 2021): Btw. I'm on `Windows Terminal Preview, Version: 1.12.3472.0` `(Windows 11, Insiders Dev, 22523.1000)` and `Ctrl+S` (pause), `Ctrl+Q` (unpause) ***seems to work correctly***, just as was said here https://github.com/microsoft/terminal/issues/809#issuecomment-492462593. Although I needed to use Google to find this exact comment to find out about this...
Author
Owner

@Gemesys commented on GitHub (Mar 8, 2024):

This is great that this functionality - that was damaged at some point - has been restored. I am training networks - on Linux, I can Ctrl-s and check output -see how things are going. But on my new Windows-11 laptop, Ctrl-s still does NOTHING. I'm glad that this has been fixed - except I find I am unable to ENABLE the fix, despite having a current machine which is updating regularly. I am guessing a registry edit is needed?
SO, what is the secret trick to actual enable Ctrl-s / Ctrl-q flow-control style pause and resume, in Windows-11 Cmd (the legacy version, of course). Thanx for any info! - M.

@Gemesys commented on GitHub (Mar 8, 2024): This is **great** that this functionality - that was damaged at some point - has been restored. I am training networks - on Linux, I can Ctrl-s and check output -see how things are going. But on my new Windows-11 laptop, Ctrl-s still does **NOTHING**. I'm glad that this has been fixed - except I find I am unable to ENABLE the fix, despite having a current machine which is updating regularly. I am guessing a registry edit is needed? SO, what is the secret trick to actual enable Ctrl-s / Ctrl-q flow-control style pause and resume, in Windows-11 Cmd (the legacy version, of course). Thanx for any info! - M.
Author
Owner

@oising commented on GitHub (Mar 8, 2024):

@Gemesys -- unfortunately this was closed by accident, as the comments in the triggering PR say ( https://github.com/microsoft/terminal/pull/15671#discussion_r1256262866 ). I'll reopen it, unless @lhecker or @DHowett-MSFT disagree.

@oising commented on GitHub (Mar 8, 2024): @Gemesys -- unfortunately this was closed by accident, as the comments in the triggering PR say ( https://github.com/microsoft/terminal/pull/15671#discussion_r1256262866 ). I'll reopen it, unless @lhecker or @DHowett-MSFT disagree.
Author
Owner

@DHowett commented on GitHub (Mar 8, 2024):

Great catch @oising!

@DHowett commented on GitHub (Mar 8, 2024): Great catch @oising!
Author
Owner

@lhecker commented on GitHub (Mar 8, 2024):

Since the PR was so long ago my memory of it is a bit hazy and I may be misreading the linked comment chain, but why do you believe this was not fixed? Ctrl+S for pausing works perfectly fine for me in OpenConsole and Windows Terminal 1.19 and later.

Edit: "perfectly fine" = "like old conhost". Dustin cleared me up about how XON/XOFF on other OS also properly pauses interactive prompts, etc., whereas the Windows implementation doesn't. Ctrl+S only pauses output for as long as you don't type any other characters. I wasn't aware about this difference and I apologize for that. We could consider changing this behavior. As far as I can tell it hasn't ever been different on Windows though even before ExtendedEditKeys was removed.

@lhecker commented on GitHub (Mar 8, 2024): Since the PR was so long ago my memory of it is a bit hazy and I may be misreading the linked comment chain, but why do you believe this was not fixed? Ctrl+S for pausing works perfectly fine for me in OpenConsole and Windows Terminal 1.19 and later. Edit: "perfectly fine" = "like old conhost". Dustin cleared me up about how XON/XOFF on other OS also properly pauses interactive prompts, etc., whereas the Windows implementation doesn't. Ctrl+S only pauses output for as long as you don't type any other characters. I wasn't aware about this difference and I apologize for that. We could consider changing this behavior. As far as I can tell it hasn't ever been different on Windows though even before ExtendedEditKeys was removed.
Author
Owner

@oising commented on GitHub (Mar 13, 2024):

Since the PR was so long ago my memory of it is a bit hazy and I may be misreading the linked comment chain, but why do you believe this was not fixed? Ctrl+S for pausing works perfectly fine for me in OpenConsole and Windows Terminal 1.19 and later.

Edit: "perfectly fine" = "like old conhost". Dustin cleared me up about how XON/XOFF on other OS also properly pauses interactive prompts, etc., whereas the Windows implementation doesn't. Ctrl+S only pauses output for as long as you don't type any other characters. I wasn't aware about this difference and I apologize for that. We could consider changing this behavior. As far as I can tell it hasn't ever been different on Windows though even before ExtendedEditKeys was removed.

Oh, well, this is news to me too :) I read the original PR as saying it wasn't implemented to spec/as expected. But it seems to function well enough for me with terminal now that I tested it.

@Gemesys Please ensure you're on the latest version of windows terminal.

@oising commented on GitHub (Mar 13, 2024): > Since the PR was so long ago my memory of it is a bit hazy and I may be misreading the linked comment chain, but why do you believe this was not fixed? Ctrl+S for pausing works perfectly fine for me in OpenConsole and Windows Terminal 1.19 and later. > > Edit: "perfectly fine" = "like old conhost". Dustin cleared me up about how XON/XOFF on other OS also properly pauses interactive prompts, etc., whereas the Windows implementation doesn't. Ctrl+S only pauses output for as long as you don't type any other characters. I wasn't aware about this difference and I apologize for that. We could consider changing this behavior. As far as I can tell it hasn't ever been different on Windows though even before ExtendedEditKeys was removed. Oh, well, this is news to me too :) I read the original PR as saying it wasn't implemented to spec/as expected. But it seems to function well enough for me with terminal now that I tested it. @Gemesys Please ensure you're on the latest version of windows terminal.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1105