CONTROL+C on close instead of CONTROL_CLOSE_EVENT #20106

Open
opened 2026-01-31 07:03:44 +00:00 by claunia · 4 comments
Owner

Originally created by @jredfox on GitHub (Jun 17, 2023).

Description of the new feature/enhancement

on closing the x button send a control+c signal to all processes by default instead of terminating them.
Definition: the x button is described as both the x button for windows terminal itself and every tab

Proposed technical implementation details (optional)

there are three ways to implement this maybe make them all options

  • Send Control+C signal and do nothing if processes don't respond. If nothing is done then the user clicks the X button a second time send a SIGTERM(CONTROL_CLOSE_EVENT) that gives the application 5s to respond before closing
  • Send Control+C signal and do nothing for 5-8s, After that prompt the user if they are sure they want to kill all processes inside before closing like macOs but not immediate as we want CLI programs to try and save on regular shutdown
  • Add an option to always use Control_CLOSE_EVENT (SIGTERM) on X button for those users that don't want the prompt and don't care about data loss / file corruption
Originally created by @jredfox on GitHub (Jun 17, 2023). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement <!-- on closing the x button send a control+c signal to all processes by default instead of terminating them. Definition: the x button is described as both the x button for windows terminal itself and every tab --> on closing the x button send a control+c signal to all processes by default instead of terminating them. Definition: the x button is described as both the x button for windows terminal itself and every tab # Proposed technical implementation details (optional) <!-- there are three ways to implement this maybe make them all options - Send Control+C signal and do nothing if processes don't respond. If nothing is done then the user clicks the X button a second time send a SIGTERM(CONTROL_CLOSE_EVENT) that gives the application 5s to respond before closing - Send Control+C signal and do nothing for 5-8s, After that prompt the user if they are sure they want to kill all processes inside before closing like macOs but not immediate as we want CLI programs to try and save on regular shutdown - Add an option to always use Control_CLOSE_EVENT (SIGTERM) on X button for those users that don't want the prompt and don't care about data loss / file corruption --> there are three ways to implement this maybe make them all options - Send Control+C signal and do nothing if processes don't respond. If nothing is done then the user clicks the X button a second time send a SIGTERM(CONTROL_CLOSE_EVENT) that gives the application 5s to respond before closing - Send Control+C signal and do nothing for 5-8s, After that prompt the user if they are sure they want to kill all processes inside before closing like macOs but not immediate as we want CLI programs to try and save on regular shutdown - Add an option to always use Control_CLOSE_EVENT (SIGTERM) on X button for those users that don't want the prompt and don't care about data loss / file corruption
claunia added the Product-ConhostIssue-TaskPriority-3Area-Server labels 2026-01-31 07:03:45 +00:00
Author
Owner

@lhecker commented on GitHub (Jun 19, 2023):

Could you clarify why this is feature would be important to you? It would help us give this feature request a priority.

@lhecker commented on GitHub (Jun 19, 2023): Could you clarify why this is feature would be important to you? It would help us give this feature request a priority.
Author
Owner

@jredfox commented on GitHub (Jun 19, 2023):

important

Most console apps using cli's are running important functions and will have file corruption if it's forcibly terminated. Always using the windows equivalent of SIGTERM isn't a good default solution it should be an opt in option not the only option.

@jredfox commented on GitHub (Jun 19, 2023): > important Most console apps using cli's are running important functions and will have file corruption if it's forcibly terminated. Always using the windows equivalent of SIGTERM isn't a good default solution it should be an opt in option not the only option.
Author
Owner

@lhecker commented on GitHub (Jun 19, 2023):

But SIGTERM is the soft exit equivalent under UNIX. Did you mean SIGQUIT? That one forcibly terminates.
CONTROL_CLOSE_EVENT is a little bit like SIGTERM's usage in upstart and systemd, because it sends an exit signal but has a timeout of 5s until it sends an equivalent of SIGQUIT. It's very similar under UNIX when a service management software is being used.
I do understand what you mean however, so I'll bring it up for discussion.

@lhecker commented on GitHub (Jun 19, 2023): But SIGTERM is the soft exit equivalent under UNIX. Did you mean SIGQUIT? That one forcibly terminates. `CONTROL_CLOSE_EVENT` is a little bit like SIGTERM's usage in upstart and systemd, because it sends an exit signal but has a timeout of 5s until it sends an equivalent of SIGQUIT. It's very similar under UNIX when a service management software is being used. I do understand what you mean however, so I'll bring it up for discussion.
Author
Owner

@lhecker commented on GitHub (Jun 21, 2023):

Woops commented on the wrong issue. 😄

@lhecker commented on GitHub (Jun 21, 2023): Woops commented on the wrong issue. 😄
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20106