mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +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:
committed by
N. Taylor Mullen
parent
ba7f1e1e3c
commit
7fd7c1a539
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user