mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Rewrite Windows console input handling
This change removes our use of ENABLE_VIRTUAL_TERMINAL_INPUT (which isn't very good) in favor of having read() translate Windows Console input events to ANSI/XTERM sequences by hand. This makes it possible to capture important keystrokes (e.g. ctrl-space) that weren't possible before. Most importantly this change also removes the stdin/sigwinch worker threads, which never really worked that well. Interactive TTY sessions will now work reliably when a Cosmo process spawns or forks another Cosmo process, e.g. unbourne.com launching emacs.com.
This commit is contained in:
parent
ececec4c94
commit
d6c2830850
27 changed files with 635 additions and 464 deletions
|
@ -55,13 +55,14 @@ textwindows int tcgetattr_nt(int fd, struct termios *tio) {
|
|||
|
||||
bzero(tio, sizeof(*tio));
|
||||
|
||||
tio->c_cc[VMIN] = 1;
|
||||
tio->c_cc[VMIN] = !(__ttymagic & kFdTtyNoBlock);
|
||||
tio->c_cc[VEOF] = __veof;
|
||||
tio->c_cc[VTIME] = __vtime;
|
||||
tio->c_cc[VINTR] = __vintr;
|
||||
tio->c_cc[VQUIT] = __vquit;
|
||||
tio->c_cc[VERASE] = CTRL('?');
|
||||
tio->c_cc[VWERASE] = CTRL('W');
|
||||
tio->c_cc[VKILL] = CTRL('U');
|
||||
tio->c_cc[VEOF] = CTRL('D');
|
||||
tio->c_cc[VMIN] = CTRL('A');
|
||||
tio->c_cc[VSTART] = _POSIX_VDISABLE;
|
||||
tio->c_cc[VSTOP] = _POSIX_VDISABLE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue