mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-01 05:00:46 +00:00
fix(cli): Handle VSCode Shift+Enter in text buffer
- The text buffer now correctly interprets `\\\r` (produced by Shift+Enter in the VSCode terminal) as a newline character. - Added a corresponding test case to `text-buffer.test.ts`. Fixes https://buganizer.corp.google.com/issues/418505364
This commit is contained in:
parent
ba7f1e1e3c
commit
7fd7c1a539
2 changed files with 13 additions and 1 deletions
|
|
@ -508,6 +508,12 @@ describe('useTextBuffer', () => {
|
|||
act(() => result.current.handleInput(textWithAnsi, {}));
|
||||
expect(getBufferState(result).text).toBe('Hello World');
|
||||
});
|
||||
|
||||
it('should handle VSCode terminal Shift+Enter as newline', () => {
|
||||
const { result } = renderHook(() => useTextBuffer({ viewport }));
|
||||
act(() => result.current.handleInput('\r', {})); // Simulates Shift+Enter in VSCode terminal
|
||||
expect(getBufferState(result).lines).toEqual(['', '']);
|
||||
});
|
||||
});
|
||||
|
||||
// More tests would be needed for:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue