Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/tty_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,17 @@ void TTYWrap::SetRawMode(const FunctionCallbackInfo<Value>& args) {
TTYWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(
&wrap, args.This(), args.GetReturnValue().Set(UV_EBADF));
int err = uv_tty_set_mode(&wrap->handle_, args[0]->IsTrue());
// UV_TTY_MODE_RAW_VT is a variant of UV_TTY_MODE_RAW that
// enables control sequence processing on the TTY implementer side,
// rather than having libuv translate keypress events into
// control sequences, aligning behavior more closely with
// POSIX platforms. This is also required to support some control
// sequences at all on Windows, such as bracketed paste mode.
// The Node.js readline implementation handles differences between
// these modes.
int err = uv_tty_set_mode(
&wrap->handle_,
args[0]->IsTrue() ? UV_TTY_MODE_RAW_VT : UV_TTY_MODE_NORMAL);
args.GetReturnValue().Set(err);
}

Expand Down
Loading