mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 20:20:57 +00:00
fix: prevent Shift+Tab from accepting prompt placeholder suggestion (#3051)
Add !key.shift guard to the Tab key handler for prompt suggestion acceptance, so Shift+Tab only toggles approval mode without inserting the placeholder text into the input. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4d2d4432d5
commit
5947512a79
2 changed files with 14 additions and 0 deletions
|
|
@ -225,6 +225,19 @@ describe('InputPrompt', () => {
|
|||
unmount();
|
||||
});
|
||||
|
||||
it('does not accept the prompt suggestion on shift+tab', async () => {
|
||||
const { stdin, unmount } = renderWithProviders(
|
||||
<InputPrompt {...props} promptSuggestion="commit this" />,
|
||||
);
|
||||
await wait(350);
|
||||
|
||||
stdin.write('\x1b[Z'); // shift+tab
|
||||
await wait();
|
||||
|
||||
expect(mockBuffer.insert).not.toHaveBeenCalled();
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('accepts and submits the prompt suggestion on Enter when the buffer is empty', async () => {
|
||||
const { stdin, unmount } = renderWithProviders(
|
||||
<InputPrompt {...props} promptSuggestion="commit this" />,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue