Commit Graph

38 Commits

Author SHA1 Message Date
Bert Belder
83626b6bc2 win/tty: don't touch insert mode or quick edit mode
This is a back-port of 4abad23, whichi is supposed to fix
joyent/node#4809.

The private `original_console_mode` field in the uv_tty_t struct has
been renamed, but couldn't be removed because changing the ABI isn't
allowed on stable branches.
2013-03-08 12:56:32 +01:00
Bert Belder
b77139964b win/tty: fix case where uv_read_start incorrectly reports failure
In very rare circumstances a uv_read_start() call on a uv_tty_t handle
in raw mode would return -1 but there was no actual failure. This patch
fixes that.
2013-03-08 12:45:11 +01:00
Bert Belder
b2dc1e6d64 win/tty: reset background brightness when color is set to default 2012-09-14 17:50:45 +02:00
Ben Noordhuis
95e89c6a0e unix, windows: share uv__handle_init() 2012-06-13 01:28:58 +02:00
Bert Belder
60746b03cb windows: move some stream functions to stream-inl.h 2012-06-04 18:04:47 +02:00
Bert Belder
d8b95eaffb windows: inline a couple of handle functions 2012-06-02 23:38:16 +02:00
Bert Belder
d402604118 windows: inline a couple of inline request functions 2012-06-02 23:08:22 +02:00
Bert Belder
961e0cf8da windows/tty: never report error after forcibly aborting line-buffered read 2012-06-02 03:08:48 +02:00
Ben Noordhuis
171ad8567d unix, windows: add uv_walk()
Lets the libuv user iterate over the open handles. Mostly intended as a
debugging tool or a post-hoc cleanup mechanism.
2012-05-30 02:33:39 +02:00
Ben Noordhuis
9efa8b3571 unix, windows: rework reference counting scheme
This commit changes how the event loop determines if it needs to stay alive.

Previously, an internal counter was increased whenever a handle got created
and decreased again when the handle was closed.

While conceptually simple, it turned out hard to work with: you often want
to keep the event loop alive only if the handle is actually doing something.
Stopped or inactive handles were a frequent source of hanging event loops.

That's why this commit changes the reference counting scheme to a model where
a handle only references the event loop when it's active. 'Active' means
different things for different handle types, e.g.:

 * timers: ticking
 * sockets: reading, writing or listening
 * processes: always active (for now, subject to change)
 * idle, check, prepare: only active when started

This commit also changes how the uv_ref() and uv_unref() functions work: they
now operate on the level of individual handles, not the whole event loop.

The Windows implementation was done by Bert Belder.
2012-05-17 07:07:53 +02:00
Ben Noordhuis
ce129ac6e2 windows: remove unused variables 2012-05-03 19:50:49 +02:00
Bert Belder
e99fba47c8 Merge remote-tracking branch 'origin/v0.6'
Conflicts:
	src/win/pipe.c
	test/run-tests.c
2012-03-09 16:41:12 +01:00
Bert Belder
5d21056277 Windows: make sure that shutdown_cb is always called
This patch changes how uv-win uses the UV_SHUTTING and UV_SHUT flags.
UV_SHUT is now only used for tcp handles to track whether shutdown() has
actually been called. UV_SHUTTING has the more generic meaning of
"no longer readable". It would be good to replace it by an actual
UV_READABLE flag in the future.

This makes the shutdown_close_tcp and shutdown_close_pipe tests pass on
windows.
2012-03-09 16:31:16 +01:00
Bert Belder
95296dfa3c Windows: make the refcount tests pass 2012-03-09 16:31:15 +01:00
Ben Noordhuis
4e1f2b1f64 Merge remote-tracking branch 'origin/v0.6' 2012-02-12 16:10:05 +01:00
Bert Belder
443445a3c6 Windows: reset brightness when reverting to default text color 2012-02-05 19:54:26 +01:00
Ben Noordhuis
3de0411591 Merge remote-tracking branch 'origin/v0.6' 2012-01-27 22:23:26 +01:00
Brandon Benvie
3ade5f0011 Windows: Add support for interpreting axiterm-style colors. 2012-01-23 20:06:24 +01:00
Shigeki Ohtsu
ba52023ef3 Fix missing increments of loop->counters 2011-12-12 18:01:26 +01:00
Bert Belder
9c064fbbd2 Win: utf-8 decoder bug when compiling with gcc 2011-12-01 22:45:58 +01:00
Bruce Mitchener
d513d9bb41 Fix typos. 2011-11-30 14:35:13 +01:00
Bert Belder
45882e0bdc win: flush output buffer before doing a console reset 2011-10-21 18:42:38 -07:00
Bert Belder
fb7138614d Improve ansi escape code support on windows 2011-10-20 19:31:24 -07:00
Igor Zinkovsky
54982a23ef windows: stdio over non-overlapped pipes 2011-10-20 15:14:39 -07:00
Ryan Dahl
5656e3c8bd Prepare for writable TTY to be blocking 2011-10-10 13:25:46 -07:00
Ryan Dahl
fe18438416 add uv_tty_reset_mode() 2011-09-30 13:09:06 -07:00
Igor Zinkovsky
e7a53aed48 fix windows build 2011-09-28 11:52:08 -07:00
Erick Tryzelaar
23796d208c Fixes #76. Unify OS error reporting
As a nice fringe benefit, this also shaves a word
off of a windows TCP handle by replacing "uv_err_t
bind_error" with "int bind_error".
2011-09-27 19:05:33 -07:00
Ben Noordhuis
fbbc085448 Rename COUNTOF() to ARRAY_SIZE().
Consistent with Node, it has an ARRAY_SIZE() macro but not COUNTOF().
2012-01-18 15:48:31 +01:00
Bert Belder
bdac72cc93 win tty: Implement uv_close and uv_shutdown 2011-09-27 19:12:39 +02:00
Bert Belder
554cb78eeb win tty: Use NULL consistently, don't mix with INVALID_HANDLE_VALUE 2011-09-27 19:12:33 +02:00
Bert Belder
f5f005d51d tty-win: fix absolute cursor positioning 2011-09-27 16:10:38 +02:00
Bert Belder
b0a9d601c8 win: tty fixes 2011-09-27 12:41:38 +02:00
Bert Belder
622eb99113 win: implement tty
loose end: line-buffered input reads ascii, not unicode
2011-09-26 19:31:32 +02:00
Ryan Dahl
03d0c57ea2 Remove uv_is_tty. Use uv_guess_handle instead. 2011-09-23 10:01:45 -07:00
Ryan Dahl
03652596cf unix: add uv_guess_handle and uv_tty_get_winsize 2011-09-22 19:35:46 -07:00
Ryan Dahl
c1374ba587 Add uv_is_tty() 2011-09-20 11:48:47 -07:00
Ryan Dahl
4484d61fe1 Add interfaces for uv_pipe_open, uv_tty_init, uv_tty_set_mode
Nothing works - no tests. This is just to coordinate efforts between Bert
and I.
2011-09-12 14:32:14 -07:00