How to interrupt program without Ctrl-C? #1143

Closed
opened 2026-01-30 22:17:28 +00:00 by claunia · 6 comments
Owner

Originally created by @nataliethistime on GitHub (May 16, 2019).

  • Your Windows build number

Microsoft Windows [Version 10.0.17134.765]

  • What you're doing and what's happening:

I often use Ctrl-C to interrupt and restart a program however with the copy/paste functions now using the control key I'm not seeing a way to do this?

Originally created by @nataliethistime on GitHub (May 16, 2019). * Your Windows build number `Microsoft Windows [Version 10.0.17134.765]` * What you're doing and what's happening: I often use Ctrl-C to interrupt and restart a program however with the copy/paste functions now using the control key I'm not seeing a way to do this?
claunia added the Issue-Question label 2026-01-30 22:17:28 +00:00
Author
Owner

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

If no text is selected, typing Ctrl+C should generate a CTRL_C_EVENT in all processes that are attached to the console. If text is selected, Ctrl+C copies to the clipboard and clears the selection. Press Ctrl+C a second time to generate the event.

It's up to a program how it should handle this control event. It can ignore it or exit gracefully. By default a program started in a new console process group ignores Ctrl+C (e.g. CMD's start /B creates a new process group). Try Ctrl+Break if Ctrl+C seems to be ignored. Ctrl+Break is rarely ignored, except by shells such as CMD. Usually Ctrl+Break is left to the default handler (i.e. exit immediately with STATUS_CONTROL_C_EXIT) or at least is handled by exiting gracefully.

@eryksun commented on GitHub (May 16, 2019): If no text is selected, typing Ctrl+C should generate a `CTRL_C_EVENT` in all processes that are attached to the console. If text is selected, Ctrl+C copies to the clipboard and clears the selection. Press Ctrl+C a second time to generate the event. It's up to a program how it should handle this control event. It can ignore it or exit gracefully. By default a program started in a new console process group ignores Ctrl+C (e.g. CMD's `start /B` creates a new process group). Try Ctrl+Break if Ctrl+C seems to be ignored. Ctrl+Break is rarely ignored, except by shells such as CMD. Usually Ctrl+Break is left to the default handler (i.e. exit immediately with `STATUS_CONTROL_C_EXIT`) or at least is handled by exiting gracefully.
Author
Owner

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

As @eryksun says, this is up to the shell you're running, not to the Windows Terminal program.

@binarycrusader commented on GitHub (May 16, 2019): As @eryksun says, this is up to the shell you're running, not to the Windows Terminal program.
Author
Owner

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

See also #813

@binarycrusader commented on GitHub (May 16, 2019): See also #813
Author
Owner

@nataliethistime commented on GitHub (May 21, 2019):

@eryksun I am using CMD and I can't seem to be able to do Ctrl-Break due to a lack of a Break key on my keyboard. Do you know of any alternatives?

I appreciate the help.

@nataliethistime commented on GitHub (May 21, 2019): @eryksun I am using CMD and I can't seem to be able to do Ctrl-Break due to a lack of a Break key on my keyboard. Do you know of any alternatives? I appreciate the help.
Author
Owner

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

You may have an fn key that shifts another key to pause/break. Otherwise use the on-screen keyboard.

@eryksun commented on GitHub (May 21, 2019): You may have an fn key that shifts another key to pause/break. Otherwise use the on-screen keyboard.
Author
Owner

@K4pt4n commented on GitHub (Jul 20, 2022):

using powershell 7.2.5 to run a ping -t command is not interruptible. Ctrl+c does not work. Ctrl+Break from the on-screen keyboard does not work.
Any other ideas? Kinda annoying.

@K4pt4n commented on GitHub (Jul 20, 2022): using powershell 7.2.5 to run a ping -t command is not interruptible. Ctrl+c does not work. Ctrl+Break from the on-screen keyboard does not work. Any other ideas? Kinda annoying.
Sign in to join this conversation.
No Label Issue-Question
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1143