[PR #5472] [MERGED] Re-enable Ctrl-C if the application that spawned us disabled it #26339

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5472
Author: @DHowett-MSFT
Created: 4/22/2020
Status: Merged
Merged: 4/23/2020
Merged by: @DHowett-MSFT

Base: masterHead: dev/duhowett/more_ctrl_c


📝 Commits (1)

  • d3b48b1 Re-enable Ctrl-C if the application that spawned us disabled it

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 src/cascadia/WindowsTerminal/main.cpp (+7 -0)

📄 Description

If Terminal is spawned by a shortcut that requests that it run in a new process group
while attached to a console session, that request is nonsense. That request will, however,
cause WT to start with Ctrl-C disabled. This wouldn't matter, because it's a Windows-subsystem
application. Unfortunately, that state is heritable. In short, if you start WT using cmd in
a weird way, ^C stops working inside the terminal. Mad.

Fixes #5460.


🔄 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/5472 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 4/22/2020 **Status:** ✅ Merged **Merged:** 4/23/2020 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `dev/duhowett/more_ctrl_c` --- ### 📝 Commits (1) - [`d3b48b1`](https://github.com/microsoft/terminal/commit/d3b48b1300ab22ffce55e59d6f33707f8952827f) Re-enable Ctrl-C if the application that spawned us disabled it ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/WindowsTerminal/main.cpp` (+7 -0) </details> ### 📄 Description If Terminal is spawned by a shortcut that requests that it run in a new process group while attached to a console session, that request is nonsense. That request will, however, cause WT to start with Ctrl-C disabled. This wouldn't matter, because it's a Windows-subsystem application. Unfortunately, that state is heritable. In short, if you start WT using cmd in a weird way, ^C stops working _inside_ the terminal. Mad. Fixes #5460. --- <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:15:27 +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#26339