[PR #14214] [MERGED] Skip DECPS/MIDI output on Ctrl+C/Break #29997

Open
opened 2026-01-31 09:38:05 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14214
Author: @lhecker
Created: 10/13/2022
Status: Merged
Merged: 10/31/2022
Merged by: @DHowett

Base: mainHead: dev/lhecker/fix-midi-freezes


📝 Commits (3)

  • fc3d134 Skip DECPS/MIDI output on Ctrl+C/Break
  • 8eba770 Simplify SetTimer, Fix x86 build
  • e5643c1 Address feedback

📊 Changes

12 files changed (+106 additions, -159 deletions)

View changed files

📝 src/audio/midi/MidiAudio.cpp (+19 -48)
📝 src/audio/midi/MidiAudio.hpp (+9 -18)
📝 src/audio/midi/precomp.h (+3 -1)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+33 -47)
📝 src/cascadia/TerminalControl/ControlCore.h (+3 -4)
📝 src/host/consoleInformation.cpp (+6 -26)
📝 src/host/globals.cpp (+4 -0)
📝 src/host/input.cpp (+20 -0)
📝 src/host/output.cpp (+0 -2)
📝 src/host/outputStream.cpp (+4 -11)
📝 src/host/server.h (+1 -2)
📝 src/interactivity/base/ServiceLocator.cpp (+4 -0)

📄 Description

Silent MIDI notes can be used to seemingly deny a user's input for long
durations (multiple minutes). This commit improves the situation by ignoring
all DECPS sequences for a second when Ctrl+C/Ctrl+Break is pressed.

Additionally it fixes a regression introduced in 666c446:
When we close a tab we need to unblock/shutdown MidiAudio early,
so that ConptyConnection::Close() can run down as fast as possible.

Validation Steps Performed

  • In pwsh in Windows Terminal 1.16 run while ($True) { echo "`e[3;8;3,~" }
    • Ctrl+C doesn't do anything
    • Closing the tab doesn't do anything
  • With these modifications in Windows Terminal:
    • Ctrl+C stops the output
    • Closing the tab completes instantly
  • With these modifications in OpenConsole:
    • Ctrl+C stops the output
    • Closing the window completes instantly

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/14214 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 10/13/2022 **Status:** ✅ Merged **Merged:** 10/31/2022 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/lhecker/fix-midi-freezes` --- ### 📝 Commits (3) - [`fc3d134`](https://github.com/microsoft/terminal/commit/fc3d134877960e861e7cf4f1e9f843bd8e745aa6) Skip DECPS/MIDI output on Ctrl+C/Break - [`8eba770`](https://github.com/microsoft/terminal/commit/8eba770267203d3a7db5311f84010b3b7e44c09e) Simplify SetTimer, Fix x86 build - [`e5643c1`](https://github.com/microsoft/terminal/commit/e5643c1a8c66c0e0dfca17ac626fb2b583c603eb) Address feedback ### 📊 Changes **12 files changed** (+106 additions, -159 deletions) <details> <summary>View changed files</summary> 📝 `src/audio/midi/MidiAudio.cpp` (+19 -48) 📝 `src/audio/midi/MidiAudio.hpp` (+9 -18) 📝 `src/audio/midi/precomp.h` (+3 -1) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+33 -47) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+3 -4) 📝 `src/host/consoleInformation.cpp` (+6 -26) 📝 `src/host/globals.cpp` (+4 -0) 📝 `src/host/input.cpp` (+20 -0) 📝 `src/host/output.cpp` (+0 -2) 📝 `src/host/outputStream.cpp` (+4 -11) 📝 `src/host/server.h` (+1 -2) 📝 `src/interactivity/base/ServiceLocator.cpp` (+4 -0) </details> ### 📄 Description Silent MIDI notes can be used to seemingly deny a user's input for long durations (multiple minutes). This commit improves the situation by ignoring all DECPS sequences for a second when Ctrl+C/Ctrl+Break is pressed. Additionally it fixes a regression introduced in 666c446: When we close a tab we need to unblock/shutdown `MidiAudio` early, so that `ConptyConnection::Close()` can run down as fast as possible. ## Validation Steps Performed * In pwsh in Windows Terminal 1.16 run ``while ($True) { echo "`e[3;8;3,~" }`` * Ctrl+C doesn't do anything ❎ * Closing the tab doesn't do anything ❎ * With these modifications in Windows Terminal: * Ctrl+C stops the output ✅ * Closing the tab completes instantly ✅ * With these modifications in OpenConsole: * Ctrl+C stops the output ✅ * Closing the window completes instantly ✅ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:38:05 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29997