| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4ae6a1a commit c094bea
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,7 +116,17 @@ void TTYWrap::SetRawMode(const FunctionCallbackInfo<Value>& args) { | |||
| 116 | 116 | TTYWrap* wrap; | |
| 117 | 117 | ASSIGN_OR_RETURN_UNWRAP( | |
| 118 | 118 | &wrap, args.This(), args.GetReturnValue().Set(UV_EBADF)); | |
| 119 | - int err = uv_tty_set_mode(&wrap->handle_, args[0]->IsTrue()); | ||
| 119 | + // UV_TTY_MODE_RAW_VT is a variant of UV_TTY_MODE_RAW that | ||
| 120 | + // enables control sequence processing on the TTY implementer side, | ||
| 121 | + // rather than having libuv translate keypress events into | ||
| 122 | + // control sequences, aligning behavior more closely with | ||
| 123 | + // POSIX platforms. This is also required to support some control | ||
| 124 | + // sequences at all on Windows, such as bracketed paste mode. | ||
| 125 | + // The Node.js readline implementation handles differences between | ||
| 126 | + // these modes. | ||
| 127 | + int err = uv_tty_set_mode( | ||
| 128 | + &wrap->handle_, | ||
| 129 | + args[0]->IsTrue() ? UV_TTY_MODE_RAW_VT : UV_TTY_MODE_NORMAL); | ||
| 120 | 130 | args.GetReturnValue().Set(err); | |
| 121 | 131 | } | |
| 122 | 132 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments