Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tui): avoid tui shutdown on unrecognized input #9289

Merged
merged 4 commits into from
Oct 19, 2024

Conversation

chris-olszewski
Copy link
Member

Description

This PR does 3 things:

  • Fix run summary from being printed out during watch mode which corrupts the TUI
  • Adds additional debug logs recording the reason for the TUI shutting down
  • Fixes bug where poll could now return None even if input streams were still available

The bug came down to:

  • A crossterm event was received
  • Translating the crossterm event via input_options.handle_crossterm_event returned None (This makes total sense, not every terminal event requires a response from the TUI)
  • This None was returned instead of waiting for more input or a tick event
  • The while let Some(event) = poll(...) loop would exit which triggers a TUI shut down

Testing Instructions

npx create-turbo@latest and then start up the TUI turbo dev --ui=tui, without hitting Enter to focus the task hit q multiple times and you should see the TUI shut down.

Use turbo built from this PR and try the same thing. The TUI should not shut down on the press of q.

@chris-olszewski chris-olszewski marked this pull request as ready for review October 19, 2024 04:19
@chris-olszewski chris-olszewski requested a review from a team as a code owner October 19, 2024 04:19
Copy link

vercel bot commented Oct 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2024 4:40am
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Oct 19, 2024 4:40am
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Oct 19, 2024 4:40am
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Oct 19, 2024 4:40am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Oct 19, 2024 4:40am
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Oct 19, 2024 4:40am
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Oct 19, 2024 4:40am
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Oct 19, 2024 4:40am
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Oct 19, 2024 4:40am

crates/turborepo-ui/src/tui/app.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants