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 7e4adfb2fd
commit 8d5c8a6fad
27 changed files with 487 additions and 298 deletions
+10 -3
View File
@@ -114,7 +114,13 @@ describe(`useKeypress`, () => {
const key = { name: 'return', sequence: '\x1B\r' };
act(() => stdin.write(key.sequence));
expect(onKeypress).toHaveBeenCalledWith(
expect.objectContaining({ ...key, meta: true }),
expect.objectContaining({
...key,
shift: false,
alt: true,
ctrl: false,
cmd: false,
}),
);
});
@@ -140,9 +146,10 @@ describe(`useKeypress`, () => {
expect(onKeypress).toHaveBeenCalledTimes(1);
expect(onKeypress).toHaveBeenCalledWith({
name: 'paste',
ctrl: false,
meta: false,
shift: false,
alt: false,
ctrl: false,
cmd: false,
insertable: true,
sequence: pasteText,
});