File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
packages/core/src/prompts Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @clack/core ' : patch
3+ ' @clack/prompts ' : patch
4+ ---
5+
6+ Enable hard line-wrapping behavior for long words without spaces
Original file line number Diff line number Diff line change @@ -205,15 +205,14 @@ export default class Prompt {
205205 this . unsubscribe ( ) ;
206206 }
207207
208- // TODO: handle wrapping
209208 private restoreCursor ( ) {
210- const lines = wrap ( this . _prevFrame , process . stdout . columns ) . split ( '\n' ) . length - 1 ;
209+ const lines = wrap ( this . _prevFrame , process . stdout . columns , { hard : true } ) . split ( '\n' ) . length - 1 ;
211210 this . output . write ( cursor . move ( - 999 , lines * - 1 ) ) ;
212211 }
213212
214213 private _prevFrame = '' ;
215214 private render ( ) {
216- const frame = wrap ( this . _render ( this ) ?? '' , process . stdout . columns ) ;
215+ const frame = wrap ( this . _render ( this ) ?? '' , process . stdout . columns , { hard : true } ) ;
217216 if ( frame === this . _prevFrame ) return ;
218217
219218 if ( this . state === 'initial' ) {
You can’t perform that action at this time.
0 commit comments