You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repl: strange behaviour in the last nightlies on Windows #18189
Fwiw, I cannot reproduce the exact problem as described by you, but printing a simple non-ASCII string like '\xf6' seems to be enough to trigger this issue. :/
But yes, it seems like this is being triggered by #18019, and in released versions of Node this also doesn't quite work the way I'd expect it to:
>fs.writeSync(1,'Ö\n')├û3
I guess that's happening because the default code page isn't expecting UTF-8?
Thinking a bit harder about it, I think it's okay to just revert the changes to lib/tty.js from that PR. libuv supports blocking uv_try_write()s for TTYs across platforms, and even if that were not the case, nothing terribly bad actually happens. (I'll open a PR with that shortly.)
As a side note: We currently actually recommendfs.writeSync(1, ...) in the async_hooks docs as a way to do synchronous logging. If that is broken on Windows we might want to re-think that recommendation and/or just expose process._rawDebug or some other fprintf(stderr, ...) thingy as public API. /cc @AndreasMadsen
Activity
apapirovski commentedon Jan 16, 2018
/cc @addaleax it seems very likely this is related to 8b751f7
addaleax commentedon Jan 17, 2018
@vsemozhetbyt @apapirovski Thanks, I’ll take a look!
addaleax commentedon Jan 17, 2018
Fwiw, I cannot reproduce the exact problem as described by you, but printing a simple non-ASCII string like
'\xf6'seems to be enough to trigger this issue. :/But yes, it seems like this is being triggered by #18019, and in released versions of Node this also doesn't quite work the way I'd expect it to:
I guess that's happening because the default code page isn't expecting UTF-8?
Thinking a bit harder about it, I think it's okay to just revert the changes to
lib/tty.jsfrom that PR. libuv supports blockinguv_try_write()s for TTYs across platforms, and even if that were not the case, nothing terribly bad actually happens. (I'll open a PR with that shortly.)As a side note: We currently actually recommend
fs.writeSync(1, ...)in the async_hooks docs as a way to do synchronous logging. If that is broken on Windows we might want to re-think that recommendation and/or just exposeprocess._rawDebugor some otherfprintf(stderr, ...)thingy as public API. /cc @AndreasMadsentty: fix console printing on Windows
vsemozhetbyt commentedon Jan 17, 2018
FWIW, changing of a shell code page seems to not fix the issue:
addaleax commentedon Jan 17, 2018
@vsemozhetbyt Can you try #18214 and see if you’re still seeing those issues?
tty: fix console printing on Windows
tty: fix console printing on Windows
tty: fix console printing on Windows
tty: fix console printing on Windows
tty: fix console printing on Windows