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