rl.prompt([preserveCursor])
preserveCursor
<boolean> 如果为true
,则阻止将光标落点重置为0
。
rl.prompt()
方法将 readline.Interface
实例配置的提示写入 output
中的新一行,以便为用户提供一个可供输入的新位置。
当调用时,如果 input
流已暂停,则 rl.prompt()
将恢复它。
如果 readline.Interface
创建时 output
被设置为 null
或 undefined
,则不会写入提示。
preserveCursor
<boolean> Iftrue
, prevents the cursor placement from being reset to0
.
The rl.prompt()
method writes the readline.Interface
instances configured
prompt
to a new line in output
in order to provide a user with a new
location at which to provide input.
When called, rl.prompt()
will resume the input
stream if it has been
paused.
If the readline.Interface
was created with output
set to null
or
undefined
the prompt is not written.