Ctrl+C (interrupt) seems hardcoded and non remappable using msys2-bash #11721

Open
opened 2026-01-31 02:55:44 +00:00 by claunia · 0 comments
Owner

Originally created by @csdvrx on GitHub (Dec 7, 2020).

Environment

Latest versions available: Windows 20H2 + Windows Terminal Dev (1.5.3242.0)

Latest msys2 with default installation in C:\msys64 started with:
"commandline": "C:/msys64/usr/bin/env.exe MSYS=winsymlinks:nativestrict MSYSTEM=MSYS /bin/bash.exe --login -i",

GNU bash, version 4.4.23(2)-release (x86_64-pc-msys)

Steps to reproduce

Redefine interrupt on a new bash with:

stty intr ^X

Expected behavior

In mintty and other terminals, after stty intr ^X the interrupt definition and key sequence are both remapped, therefore:

  • press ctrl-c : nothing happens

  • press ctrl-x : ^X is shown and interrupt is sent

Actual behavior

However, in Windows Terminal, after stty intr ^X only the interrupt definition is changed:

  • press ctrl-x : nothing happens

  • press ctrl-c : ^X is shown and interrupt is sent

This is the exact opposite, and an undesirable behavior for any terminal application that voluntarily remaps Ctrl-C to a less common sequence, for example to prevent user interruption.

It suggests Ctrl-C is hardcoded somewhere to always generate interrupt, which will then send whatever the sequence defined by stty is, instead of using stty definition to also change the configured value and to match stty definition

Likely related to #4958, where Ctrl-Z is being processed even in raw mode, and pointing to deeper issues

Originally created by @csdvrx on GitHub (Dec 7, 2020). # Environment Latest versions available: Windows 20H2 + Windows Terminal Dev (1.5.3242.0) Latest msys2 with default installation in C:\msys64 started with: "commandline": "C:/msys64/usr/bin/env.exe MSYS=winsymlinks:nativestrict MSYSTEM=MSYS /bin/bash.exe --login -i", GNU bash, version 4.4.23(2)-release (x86_64-pc-msys) # Steps to reproduce Redefine interrupt on a new bash with: stty intr ^X # Expected behavior In mintty and other terminals, after stty intr ^X the interrupt definition and key sequence are both remapped, therefore: - press ctrl-c : nothing happens - press ctrl-x : ^X is shown and interrupt is sent # Actual behavior However, in Windows Terminal, after stty intr ^X only the interrupt definition is changed: - press ctrl-x : nothing happens - press ctrl-c : ^X is shown and interrupt is sent This is the exact opposite, and an undesirable behavior for any terminal application that voluntarily remaps Ctrl-C to a less common sequence, for example to prevent user interruption. It suggests Ctrl-C is hardcoded somewhere to always generate interrupt, which will then send whatever the sequence defined by stty is, instead of using stty definition to also change the configured value and to match stty definition Likely related to #4958, where Ctrl-Z is being processed even in raw mode, and pointing to deeper issues
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Author-Feedback labels 2026-01-31 02:55:45 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11721