Skip to content

Commit

Permalink
fix(#127): use block character as cursor placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Dec 28, 2024
1 parent 8cba8e3 commit 35d12e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/red-glasses-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clack/core": patch
---

Fixes a cursor display bug in terminals that do not support the "hidden" escape sequence. See [Issue #127](https://github.com/bombshell-dev/clack/issues/127).
2 changes: 1 addition & 1 deletion packages/core/src/prompts/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class TextPrompt extends Prompt {
return this.value;
}
if (this.cursor >= this.value.length) {
return `${this.value}${color.inverse(color.hidden('_'))}`;
return `${this.value}`;
}
const s1 = this.value.slice(0, this.cursor);
const [s2, ...s3] = this.value.slice(this.cursor);
Expand Down

0 comments on commit 35d12e7

Please sign in to comment.