Skip to content

[Bug] when adding initiailValue there's a trailing underscore which seems to be a cursor #127

@kashive

Description

@kashive

Environment

  • OS: [e.g. macOS, Windows]: macOS
  • Node Version: [e.g. v18.14.0]: v10.9.1
  • Package: [e.g. @clack/prompts, @clack/core]: @clack/prompts": "^0.6.3",

Describe the bug
A clear and concise description of what the bug is.
When adding initiailValue for promptText there's a trailing underscore which seems to be a cursor; this leads to confusing experience, especially if we already have an underscore in the text

To Reproduce
Include a link to a minimal reproduction using node.new

const name = await promptText({
    message:
      "What's the secret name?",
    initialValue: 'MY_TOP_SECRET',
  });

Results in:
image

Steps to reproduce the behavior:

  • Include reproduction steps

Expected behavior
A clear and concise description of what you expected to happen.
There should be no underscore that acts like a cursor. Just the cursor should be displayed.

Additional Information
If applicable, add screenshots to help explain your problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions