readStream.setRawMode(mode)


  • mode <boolean> 如果为 true,将配置 tty.ReadStream 以原始设备模式运行。如果为 false,则将配置 tty.ReadStream 以默认模式运行。readStream.isRaw 属性将被设置为最终模式。
  • 返回:<this> 读取流实例。

允许配置 tty.ReadStream,使其作为原始设备运行。

【Allows configuration of tty.ReadStream so that it operates as a raw device.】

在原始模式下,输入始终可以逐字符获得,不包括修饰符。此外,终端对字符的所有特殊处理都被禁用,包括回显输入字符。在此模式下,Ctrl+C 将不再引发 SIGINT