Closed GoogleCodeExporter closed 8 years ago
OldBuild
Original comment by ConEmu.Maximus5
on 18 Dec 2014 at 6:38
Same behavior in 141217
Original comment by josh3...@gmail.com
on 18 Dec 2014 at 7:31
The answer is easy. nodejs does NOT write these codes to stdout. Here is dump
AnsiDump #57: \r\n
AnsiDump #58: \r\n
AnsiDump #59: true
AnsiDump #60: \r\n
AnsiDump #61: >
Call nodejs authors to make that working.
Or you may call GuiMacro
Original comment by ConEmu.Maximus5
on 18 Dec 2014 at 10:41
Original comment by ConEmu.Maximus5
on 18 Dec 2014 at 10:41
Ah - I have discovered the cause of this behavior.
When node's stdout is connected to a non-interactive sink (ie piped or
redirected to a file), bytes written to process.stdout are written as-is.
Thus, running `node test > out.txt` produces expected results.
However, when node is connected to an interactive terminal in Windows, it (via
libuv) actually parses all ANSI escape codes so that it can transparently
emulate a unix TTY terminal using Windows APIs. Unknown and unsupported
sequences are silently ignored. (See
https://github.com/libuv/libuv/blob/v1.x/src/win/tty.c)
As a consequence, the OSC commands are discarded between JS calling
process.stdout.write() and the call to WriteConsoleW().
This can be worked around from user code by opening a raw filesystem stream on
fd 1.
var rawStdout = new fs.SyncWriteStream(1, { autoClose: false });
Writing ANSI escape sequences to rawStdout will be emitted properly, and ConEmu
will rename the tab.
rawStdout.write('\x1b]9;3;"abc"\x1b\x5c');
Original comment by josh3...@gmail.com
on 20 Dec 2014 at 12:41
http://stackoverflow.com/a/27575930/1405560
Original comment by ConEmu.Maximus5
on 20 Dec 2014 at 8:25
Original comment by ConEmu.Maximus5
on 20 Dec 2014 at 8:25
Original issue reported on code.google.com by
josh3...@gmail.com
on 18 Dec 2014 at 1:12