-
-
Notifications
You must be signed in to change notification settings - Fork 34k
Open
Description
Version
v22.11.0
Platform
Microsoft Windows NT 10.0.26100.0 x64
Subsystem
No response
What steps will reproduce the bug?
import { CompleterResult, createInterface } from 'readline';
const rl = createInterface({
input: process.stdin,
output: process.stdout,
completer: (line: string): CompleterResult => {
return [
[
'foobar',
'foobaz'
],
line
]
}
});
rl.question(`multiline
prompt
eats
output
> `, () => { })With running the above code, type "foo" in the console and press tab, the completer successfully fill it to "fooba":
multiline
prompt
eats
output
> fooba
If try to press again to list all possible values, the multiline prompt will erase the output from the completer:
multiline
prompt
eats
multiline
prompt
eats
output
> fooba
How often does it reproduce? Is there a required condition?
As long as the prompt has more than 1 line, this issue occurs. Though you can still see the output if you prompt is 2 lines as the last line of the output from completer is an empty line.
What is the expected behavior? Why is that the expected behavior?
multiline
prompt
eats
output
> fooba
foobar foobaz
multiline
prompt
eats
output
> fooba
What do you see instead?
multiline
prompt
eats
multiline
prompt
eats
output
> fooba
Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels