Skip to content

[Bug] Leading spaces are trimmed in prompts #357

@gBasil

Description

@gBasil

Environment

  • OS: macOS
  • Node Version: v24.0.1
  • Package: @clack/core
  • Package Version: v0.5.0

Describe the bug
Clack seems to trim leading blank spaces in each line when displayed with render (at least in GroupMultiSelectPrompt, though I presume this would be a larger issue).

To Reproduce
https://stackblitz.com/edit/node-kgstubgf?file=index.mjs

Steps to reproduce the behavior:

  • Run node index.mjs in the StackBlitz project above.

Expected behavior
The blank spaces at the beginning of the line should not be removed

Additional Information
When a non-space character is put at the start, the spaces after it are properly rendered. Also, other unicode space characters seem to work (i.e. zero-width spaces (\u200B)), just not the one placed by the space bar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions