remove wildcard behavior on keybindings (#21315)

This commit is contained in:
Tommaso Sciortino
2026-03-05 22:11:53 +00:00
committed by GitHub
parent e8bc7bea44
commit 19c9508fd1
10 changed files with 135 additions and 415 deletions

View File

@@ -288,7 +288,7 @@ describe('KeypressContext', () => {
expect.objectContaining({
name: 'escape',
shift: false,
alt: true,
alt: false,
cmd: false,
}),
);
@@ -297,7 +297,7 @@ describe('KeypressContext', () => {
expect.objectContaining({
name: 'escape',
shift: false,
alt: true,
alt: false,
cmd: false,
}),
);
@@ -326,7 +326,7 @@ describe('KeypressContext', () => {
expect.objectContaining({
name: 'escape',
shift: false,
alt: true,
alt: false,
cmd: false,
}),
);

View File

@@ -178,8 +178,7 @@ function nonKeyboardEventFilter(
}
/**
* Converts return keys pressed quickly after other keys into plain
* insertable return characters.
* Converts return keys pressed quickly after insertable keys into a shift+return
*
* This is to accommodate older terminals that paste text without bracketing.
*/
@@ -201,7 +200,7 @@ function bufferFastReturn(keypressHandler: KeypressHandler): KeypressHandler {
} else {
keypressHandler(key);
}
lastKeyTime = now;
lastKeyTime = key.insertable ? now : 0;
};
}
@@ -630,7 +629,7 @@ function* emitKeys(
} else if (sequence === `${ESC}${ESC}`) {
// Double escape
name = 'escape';
alt = true;
alt = false;
// Emit first escape key here, then continue processing
keypressHandler({
@@ -645,7 +644,7 @@ function* emitKeys(
} else if (escaped) {
// Escape sequence timeout
name = ch.length ? undefined : 'escape';
alt = true;
alt = ch.length > 0;
} else {
// Any other character is considered printable.
insertable = true;