Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Multiline message #101

Open
kwaa opened this issue Mar 6, 2023 · 1 comment · May be fixed by #143
Open

[Request] Multiline message #101

kwaa opened this issue Mar 6, 2023 · 1 comment · May be fixed by #143
Labels
enhancement New feature or request

Comments

@kwaa
Copy link

kwaa commented Mar 6, 2023

Is your feature request related to a problem? Please describe.

Currently, the left decorative line is not displayed when using \n line break.

import { confirm } from '@clack/prompts'

const msg = await confirm({
  message: 'Hello,\nWorld!',
}),
◆  Hello,
World!
│  ● Yes / ○ No
└

Describe the solution you'd like

Let message accept string[], like this:

import { confirm } from '@clack/prompts'

const msg = await confirm({
  message: ['Hello,', 'World!'],
}),
◆  Hello,
│  World!
│  ● Yes / ○ No
└
@kwaa kwaa added the enhancement New feature or request label Mar 6, 2023
@ulken
Copy link
Collaborator

ulken commented Mar 6, 2023

When we properly support multi line/textarea prompts, we could probably utilize parts of it for message as well.

Not entirely sold on the proposed API, though. I would prefer proper support for template strings with newlines baked in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Needs triage
2 participants