Skip to content
Open
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
4 changes: 3 additions & 1 deletion internal/utils/flags/project_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ func ParseProjectRef(ctx context.Context, fsys afero.Fs) error {
}
// Prompt as the last resort
if term.IsTerminal(int(os.Stdin.Fd())) {
return PromptProjectRef(ctx, "Select a project:")
// Interactive prompts should always be written to stderr
opts := []tea.ProgramOption{tea.WithOutput(os.Stderr)}
return PromptProjectRef(ctx, "Select a project:", opts...)
Copy link
Contributor

Choose a reason for hiding this comment

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

Interactive prompts should always be written to stderr. Can you double check the implementation of PromptProjectRef?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah aight, Fixed to always use stderr.
Removed the conditional and now always passing tea.WithOutput(os.Stderr).
PromptProjectRef correctly passes opts through to PromptChoice.
Tested with supabase gen types > file.ts and output is clean.

}
return errors.New(utils.ErrNotLinked)
}
Expand Down
Loading