Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-prompt-text-wrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/cli": patch
---

Fixed `Prompt.text` rendering duplicate lines when input text wraps to a new terminal line.
5 changes: 4 additions & 1 deletion packages/cli/src/internal/prompt/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ function renderClearScreen(state: State, options: Options) {
)
})
// Ensure that the prior prompt output is cleaned up
const clearOutput = InternalAnsiUtils.eraseText(options.message, columns)
// Calculate full rendered line: "? " + message + " › " + input
const inputValue = state.value.length > 0 ? state.value : options.default
const fullLine = `? ${options.message} \u203a ${inputValue}`
const clearOutput = InternalAnsiUtils.eraseText(fullLine, columns)
// Concatenate and render all documents
return clearError.pipe(
Doc.cat(clearOutput),
Expand Down
Loading