libuv/docs/src
Anna Henningsen 843b64faf5
win: add ENABLE_VIRTUAL_TERMINAL_INPUT raw tty mode (#4688)
Windows provides the `ENABLE_VIRTUAL_TERMINAL_INPUT` flag for TTY input
streams as a companion flag to `ENABLE_VIRTUAL_TERMINAL_PROCESSING`,
which libuv is already setting for TTY output streams.

Setting this flag lets the terminal emulator perform some of the
processing that libuv already currently does for input events,
but most notably enables receiving control sequences that are
otherwise entirely unavailable, e.g. for bracketed paste
(which the Node.js readline implementation added basic support for
in https://github.com/nodejs/node/commit/87af913b66eab78088acfd).

libuv currently already provides translations for key events to
control sequences, i.e. what this mode is intended to provide,
but libuv does not and cannot translate all such events.
Since the control sequences differ from the ones that Windows
has chosen to standardize on, and applications may not be expecting
this change, this is opt-in for now (but ideally will be the default
behavior starting in libuv v2.x, should that ever happen).

Another downside of this change is that not all shells reset
this mode when an application exits. For example, when running a
Node.js program with this flag enabled inside of PowerShell in
Windows terminal, if the application exits while in raw TTY input mode,
neither the shell nor the terminal emulator reset this flag, rendering
the input stream unusable.

While there's general awareness of the problem that console state is
global state rather than per-process (same as on UNIX platforms),
it seems that applications like PowerShell aren't expecting to need to
unset this flag on the input stream, only its output counterpart
(e.g. 4e7942135f/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs (L1156)).

Hence, `uv_tty_reset_mode()` is extended to reset the terminal
to its original state if the new mode is being used.

Refs: 87af913b66
Refs: https://github.com/microsoft/terminal/issues/4954
2025-02-21 23:34:53 +01:00
..
guide doc: fix some typos 2024-04-26 13:57:26 +02:00
sphinx-plugins doc: fix most sphinx warnings 2020-08-18 13:07:04 -04:00
static win,unix: change execution order of timers (#3927) 2023-03-20 10:04:57 -06:00
api.rst core: add API to measure event loop idle time 2020-08-04 10:31:42 -04:00
async.rst doc: fix most sphinx warnings 2020-08-18 13:07:04 -04:00
check.rst doc: check/idle/prepare functions always succeed 2020-04-28 20:06:55 +02:00
conf.py doc: switch to Furo, a more modern Sphinx theme (#4094) 2023-08-14 15:27:18 -04:00
design.rst win,unix: change execution order of timers (#3927) 2023-03-20 10:04:57 -06:00
dll.rst doc: add uv_dlsym() return type 2015-09-02 09:58:55 +02:00
dns.rst doc: document uv_getnameinfo_t.{host|service} 2015-03-02 16:53:57 +01:00
errors.rst include: add EUNATCH errno mapping (#4047) 2023-06-16 09:27:39 -04:00
fs_event.rst test: address FreeBSD kernel bug causing NULL path in fsevents (#4649) 2024-12-13 15:30:17 -05:00
fs_poll.rst docs: improve UV_ENOBUFS scenario documentation 2017-03-08 20:55:40 -05:00
fs.rst unix,win: accept NAN/INFINITY as file timestamps (#4702) 2025-02-21 23:08:15 +01:00
guide.rst doc: add warning note to user guide 2017-04-28 11:15:53 +02:00
handle.rst doc: properly label enumerations and types (#4506) 2024-08-16 19:30:06 +02:00
idle.rst doc: check/idle/prepare functions always succeed 2020-04-28 20:06:55 +02:00
index.rst doc: fix README link text (#4693) 2025-02-08 09:42:12 -05:00
loop.rst doc: fix the uv_*_set_data series of functions 2024-08-16 09:13:42 +02:00
metrics.rst src: add new metrics APIs (#3749) 2022-11-11 16:21:58 +01:00
migration_010_100.rst doc: fix spelling 2014-11-29 04:22:56 +01:00
misc.rst misc: implement uv_getrusage_thread (#4666) 2025-01-14 14:50:26 +01:00
pipe.rst unix,win: add UV_PIPE_NO_TRUNCATE flag (#4040) 2023-06-06 17:08:36 +02:00
poll.rst doc: properly label enumerations and types (#4506) 2024-08-16 19:30:06 +02:00
prepare.rst doc: check/idle/prepare functions always succeed 2020-04-28 20:06:55 +02:00
process.rst doc: properly label enumerations and types (#4506) 2024-08-16 19:30:06 +02:00
request.rst doc: properly label enumerations and types (#4506) 2024-08-16 19:30:06 +02:00
signal.rst win, tty: improve SIGWINCH performance 2019-09-05 11:36:02 +02:00
stream.rst doc: more accurate list of valid send_handle's 2021-06-18 23:38:03 -04:00
tcp.rst doc: properly label enumerations and types (#4506) 2024-08-16 19:30:06 +02:00
threading.rst win: lazy-load [GS]etThreadDescription symbols (#4679) 2025-01-24 21:53:22 +01:00
threadpool.rst src: set a default thread name for workers (#4664) 2025-01-08 13:58:28 +01:00
timer.rst doc: clarify repeating timer behavior more (#4640) 2024-12-08 22:32:49 +01:00
tty.rst win: add ENABLE_VIRTUAL_TERMINAL_INPUT raw tty mode (#4688) 2025-02-21 23:34:53 +01:00
udp.rst unix,win: add uv_udp_try_send2 2024-12-13 21:52:59 +01:00
upgrading.rst doc: move "upgrading" to a standalone document 2017-04-28 11:15:04 +02:00
version.rst docs: fix linkcheck 2020-01-08 11:51:04 -05:00