fix(cli-ui): revert backspace handling to fix Windows regression (#25941)

This commit is contained in:
Tommaso Sciortino
2026-04-24 13:30:00 -07:00
committed by GitHub
parent ed469e492b
commit 048bf6e514
4 changed files with 5 additions and 101 deletions
@@ -651,20 +651,8 @@ function* emitKeys(
// tab
name = 'tab';
alt = escaped;
} else if (ch === '\b') {
// ctrl+h / ctrl+backspace (windows terminals send \x08 for ctrl+backspace)
name = 'backspace';
// In Windows environments, \b is sent for Ctrl+Backspace (standard backspace is translated to \x7f).
// We scope this to Windows/WT_SESSION to avoid breaking other unixes where \b is a plain backspace.
if (
typeof process !== 'undefined' &&
(process.env?.['OS'] === 'Windows_NT' || !!process.env?.['WT_SESSION'])
) {
ctrl = true;
}
alt = escaped;
} else if (ch === '\x7f') {
// backspace
} else if (ch === '\b' || ch === '\x7f') {
// backspace or ctrl+h
name = 'backspace';
alt = escaped;
} else if (ch === ESC) {