mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 05:24:34 -07:00
fix(cli): resolve home/end keybinding conflict (#17124)
This commit is contained in:
committed by
GitHub
parent
995ae42f53
commit
2455f939a3
@@ -356,18 +356,18 @@ describe('ScrollableList Demo Behavior', () => {
|
||||
expect(listRef?.getScrollState()?.scrollTop).toBeLessThan(2);
|
||||
});
|
||||
|
||||
// End -> \x1b[F
|
||||
// End -> \x1b[1;5F (Ctrl+End)
|
||||
await act(async () => {
|
||||
stdin.write('\x1b[F');
|
||||
stdin.write('\x1b[1;5F');
|
||||
});
|
||||
await waitFor(() => {
|
||||
// Total 50 items, height 10. Max scroll ~40.
|
||||
expect(listRef?.getScrollState()?.scrollTop).toBeGreaterThan(30);
|
||||
});
|
||||
|
||||
// Home -> \x1b[H
|
||||
// Home -> \x1b[1;5H (Ctrl+Home)
|
||||
await act(async () => {
|
||||
stdin.write('\x1b[H');
|
||||
stdin.write('\x1b[1;5H');
|
||||
});
|
||||
await waitFor(() => {
|
||||
expect(listRef?.getScrollState()?.scrollTop).toBe(0);
|
||||
|
||||
@@ -43,6 +43,7 @@ describe('keyMatchers', () => {
|
||||
createKey('a'),
|
||||
createKey('a', { shift: true }),
|
||||
createKey('b', { ctrl: true }),
|
||||
createKey('home', { ctrl: true }),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -52,6 +53,7 @@ describe('keyMatchers', () => {
|
||||
createKey('e'),
|
||||
createKey('e', { shift: true }),
|
||||
createKey('a', { ctrl: true }),
|
||||
createKey('end', { ctrl: true }),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -157,13 +159,13 @@ describe('keyMatchers', () => {
|
||||
},
|
||||
{
|
||||
command: Command.SCROLL_HOME,
|
||||
positive: [createKey('home')],
|
||||
negative: [createKey('end')],
|
||||
positive: [createKey('home', { ctrl: true })],
|
||||
negative: [createKey('end'), createKey('home')],
|
||||
},
|
||||
{
|
||||
command: Command.SCROLL_END,
|
||||
positive: [createKey('end')],
|
||||
negative: [createKey('home')],
|
||||
positive: [createKey('end', { ctrl: true })],
|
||||
negative: [createKey('home'), createKey('end')],
|
||||
},
|
||||
{
|
||||
command: Command.PAGE_UP,
|
||||
|
||||
Reference in New Issue
Block a user