Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/prompts/searchable-multi-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ async function createSearchableMultiSelect(): Promise<
* - Tab to confirm selections
*/
export async function searchableMultiSelect(config: Config): Promise<string[]> {
// Fix: Ensure stdin is in the correct state BEFORE creating the prompt
// This fixes the issue where arrow keys don't work until Enter is pressed first.
// The root cause is that welcome-screen's waitForEnter() pauses stdin before this prompt starts.
const stdin = process.stdin;
if (stdin.isTTY) {
if (!stdin.isRaw) {
stdin.setRawMode(true);
}
stdin.resume();
}

const prompt = await createSearchableMultiSelect();
return prompt(config);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/welcome-screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ function waitForEnter(): Promise<void> {
// Enter key or Ctrl+C
if (char === '\r' || char === '\n' || char === '\u0003') {
stdin.removeListener('data', onData);
stdin.setRawMode(wasRaw);
stdin.pause();
// Don't restore raw mode or pause stdin here - let the next prompt handle stdin state
Copy link
Contributor

@TabishB TabishB Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The searchableMultiSelect() guard already fixes this. I'd revert this change so waitForEnter() keeps cleaning up after itself. No need for both.

// This fixes the issue where arrow keys don't work in searchableMultiSelect after welcome screen

// Handle Ctrl+C
if (char === '\u0003') {
Expand Down
Loading