Skip to content

fix(select): recompute viewport width on resize - #747

Merged
aymanbagabas merged 1 commit into
charmbracelet:mainfrom
SergioChan:fix/resize-select-viewport-width
Mar 10, 2026
Merged

aymanbagabas merged 1 commit into
charmbracelet:mainfrom
SergioChan:fix/resize-select-viewport-width

Conversation

@SergioChan

Copy link
Copy Markdown
Contributor

Summary

  • recompute select and multi-select viewport dimensions when WithWidth is called
  • fixes stale viewport width after terminal resize, which caused wrapped/garbled rendering in select-style prompts
  • add regression tests covering width updates for both Select and MultiSelect

Testing

  • go test ./... -run 'TestSelectWithWidthUpdatesViewportWidth|TestMultiSelectWithWidthUpdatesViewportWidth'

Related

@SergioChan
SergioChan requested a review from a team as a code owner March 10, 2026 17:43
@SergioChan
SergioChan requested review from andreynering and meowgorithm and removed request for a team March 10, 2026 17:43
@aymanbagabas

Copy link
Copy Markdown
Contributor

Thank you so much @SergioChan!

@aymanbagabas
aymanbagabas merged commit ec53694 into charmbracelet:main Mar 10, 2026
19 of 20 checks passed
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.

bug: formatting breaks on resize

2 participants

⌂ 换网址