microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.79k stars 8.34k forks source link

CONTROL+C on close instead of CONTROL_CLOSE_EVENT #15571

Open jredfox opened 1 year ago

jredfox commented 1 year ago

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

lhecker commented 1 year ago

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

jredfox commented 1 year ago

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.

lhecker commented 1 year ago

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 1 year ago

Woops commented on the wrong issue. 😄