Support command/ctrl/alt backspace correctly (#17175)

This commit is contained in:
Tommaso Sciortino
2026-01-21 10:13:26 -08:00
committed by GitHub
parent e894871afc
commit f190b87223
27 changed files with 487 additions and 298 deletions

View File

@@ -53,7 +53,14 @@ describe('ShellInputPrompt', () => {
const handler = mockUseKeypress.mock.calls[0][0];
// Simulate keypress
handler({ name, sequence, ctrl: false, shift: false, meta: false });
handler({
name,
shift: false,
alt: false,
ctrl: false,
cmd: false,
sequence,
});
expect(mockWriteToPty).toHaveBeenCalledWith(1, sequence);
});
@@ -66,7 +73,7 @@ describe('ShellInputPrompt', () => {
const handler = mockUseKeypress.mock.calls[0][0];
handler({ name: key, ctrl: true, shift: true, meta: false });
handler({ name: key, shift: true, alt: false, ctrl: true, cmd: false });
expect(mockScrollPty).toHaveBeenCalledWith(1, direction);
});
@@ -78,10 +85,11 @@ describe('ShellInputPrompt', () => {
handler({
name: 'a',
sequence: 'a',
ctrl: false,
shift: false,
meta: false,
alt: false,
ctrl: false,
cmd: false,
sequence: 'a',
});
expect(mockWriteToPty).not.toHaveBeenCalled();
@@ -94,10 +102,11 @@ describe('ShellInputPrompt', () => {
handler({
name: 'a',
sequence: 'a',
ctrl: false,
shift: false,
meta: false,
alt: false,
ctrl: false,
cmd: false,
sequence: 'a',
});
expect(mockWriteToPty).not.toHaveBeenCalled();