Skip to content

Fix issue where ListPrompt throws or hangs on null key input (empty text / blank read) 2168 - #2174

Open
HillkirkLautaro wants to merge 3 commits into
spectreconsole:mainfrom
HillkirkLautaro:fix/prompt-empty-text-2168
Open

Fix issue where ListPrompt throws or hangs on null key input (empty text / blank read) 2168#2174
HillkirkLautaro wants to merge 3 commits into
spectreconsole:mainfrom
HillkirkLautaro:fix/prompt-empty-text-2168

Conversation

@HillkirkLautaro

Copy link
Copy Markdown
Contributor

Fixes #2168

  • I have read the Contribution Guidelines
  • I have checked that there isn't already another pull request that solves the above issue
  • All newly added code is adequately covered by tests
  • All existing tests are still running without errors

Changes

  • Fixed a bug in ListPrompt.Show where a null value returned from _console.Input.ReadKeyAsync (such as during empty text/key reads) could cause a malformed loop structure or unhandled flow issues.
  • Restructured the try-finally blocks and while loop handling for input reading, cursor visibility toggling (_console.Cursor.Hide() / Show()), and render hook refreshes.
  • Added a new unit test suite (MultiSelectionPromptTests and ThrowingCursor) to ensure proper cursor management and behavior when hiding the cursor throws or when input is handled under edge conditions.
  • Updated auto-generated emoji lookup mapping files.

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.

Cursor left hidden after cancelling a list prompt via CancellationToken

1 participant