Skip to content

Alternative to Inquirer Prompt for Multi-line Text Input #1583

Answered by SBoudrias
Kairu-bit asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @Kairu-bit, I'd really like the input prompt to allow inline multiline. But I think we're limited by how readline work.

If you look at the Node.js documentation example:

import * as readline from 'node:readline/promises';
import { stdin as input, stdout as output } from 'node:process';

const rl = readline.createInterface({ input, output });

const answer = await rl.question('What do you think of Node.js? ');

console.log(`Thank you for your valuable feedback: ${answer}`);

rl.close();

You'll see any press of enter will trigger the line event.

I'd be happy to work around this if we find a clever way.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Kairu-bit
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants