spinframework / spinframework/spin

Terminating the app while a prompt is waiting will not restore terminal settings

Open
#2,557 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

From https://github.com/fermyon/spin/discussions/2555:

Any time the spin program displays a prompt, waiting for a single keypress, it hides the cursor, e.g.

Are you sure you want to continue? [Y/n]

If I press ⌃C instead of pressing y or n, then the program aborts, but the cursor remains invisible (I'm using iTerm2.app on macOS).

I believe this could be fixed by hooking SIGINT (as we do for spin up via the ctrlc crate) and calling https://docs.rs/console/0.15.7/console/struct.Term.html#method.show_cursor (via dialoguer::console).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the prompt implementation and compare its interruption behavior with the existing ctrlc handling for spin up. Check how dialoguer exposes console::Term::show_cursor, then verify that sending SIGINT while a keypress prompt is waiting restores the cursor and exits cleanly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.