summaryrefslogtreecommitdiff
path: root/test/pseudo-tty
AgeCommit message (Collapse)Author
2019-11-28tty: truecolor check moved before 256 checkDuncan Healy
256 color would be return instead of 16m if both env variables were set * tty: improve color check order highest spec first * tty: add test for TERM and COLORTERM set * tty: move COLORTERM check outside TERM closure * tty: remove extra if check for COLORTERM Refs: https://github.com/nodejs/node/issues/27609 PR-URL: https://github.com/nodejs/node/pull/30474 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-10-11repl: check for NODE_REPL_EXTERNAL_MODULEGus Caplan
PR-URL: https://github.com/nodejs/node/pull/29778 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-08-19tools: make pty_helper.py python3-compatibleBen Noordhuis
Fixes: https://github.com/nodejs/node/issues/29166 PR-URL: https://github.com/nodejs/node/pull/29167 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-08-17readline: close dumb terminals on Control+Dcjihrig
This commit adds support for closing a readline interface on Control+D when the terminal is dumb. PR-URL: https://github.com/nodejs/node/pull/29149 Fixes: https://github.com/nodejs/node/issues/29111 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-07-30test: refactor test using assert instead of try/catchJuan Bedoya
PR-URL: https://github.com/nodejs/node/pull/28346 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2019-07-17test: improve variable names in pty_helper.pyAnna Henningsen
Using names like `parent_fd` and `child_fd` is more accurate here, and doesn’t come with unnecessary negative connotations, even if the previous naming is somewhat common terminology here. PR-URL: https://github.com/nodejs/node/pull/28688 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-07-15test: fix pty test hangs on aixBen Noordhuis
Some pty tests persistently hung on the AIX CI buildbots. Fix that by adding a helper script that properly sets up the pty before spawning the script under test. On investigation I discovered that the test runner hung when it tried to close the slave pty's file descriptor, probably due to a bug in AIX's pty implementation. I could reproduce it with a short C program. The test runner also leaked file descriptors to the child process. I couldn't convince python's `subprocess.Popen()` to do what I wanted it to do so I opted to move the logic to a helper script that can do fork/setsid/etc. without having to worry about stomping on state in tools/test.py. In the process I also uncovered some bugs in the pty module of the python distro that ships with macOS 10.14, leading me to reimplement a sizable chunk of the functionality of that module. And last but not least, of course there are differences between ptys on different platforms and the helper script has to paper over that. Of course. Really, this commit took me longer to put together than I care to admit. Caveat emptor: this commit takes the hacky ^D feeding to the slave out of tools/test.py and puts it in the *.in input files. You can also feed other control characters to tests, like ^C or ^Z, simply by inserting them into the corresponding input file. I think that's nice. Fixes: https://github.com/nodejs/build/issues/1820 Fixes: https://github.com/nodejs/node/issues/28489 PR-URL: https://github.com/nodejs/node/pull/28600 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-07-04test: skip pseudo-tty tests on AIXSam Roberts
See: https://github.com/nodejs/build/issues/1820 PR-URL: https://github.com/nodejs/node/pull/28541 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-07-02test: skip tests related to CI failures on AIXSam Roberts
These tests seem to trigger failures in the entire CI job (not just the test) on AIX. Skip them to see if that helps alleviate spurious failures in node-test-commit-aix (and the upstream PR and commit test jobs). See: - https://github.com/nodejs/build/issues/1820#issuecomment-505998851 - https://github.com/nodejs/build/issues/1847#issuecomment-504210708 PR-URL: https://github.com/nodejs/node/pull/28469 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-06-12assert: print more lines in the error diffRuben Bridgewater
So far consequitive identical lines were collapsed if there were at least three. Now they are only collapsed from five identical lines on. This also simplifies the implementation a tiny bit by abstracting some logic. PR-URL: https://github.com/nodejs/node/pull/28058 Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-06-10test: remove test-tty-wrap from status fileRich Trott
The test is believed to no longer be unreliable on AIX. Remove the flaky designation from the appropriate status file. Closes: https://github.com/nodejs/node/issues/9728 PR-URL: https://github.com/nodejs/node/pull/28129 Fixes: https://github.com/nodejs/node/issues/9728 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-05-16process: inspect error in case of a fatal exceptionRuben Bridgewater
This makes sure that errors that shut down the application are inspected with `util.inspect()`. That makes sure that all extra properties on the error will be visible and also that the stack trace is highlighted (Node.js internal frames will be grey and node modules are underlined). PR-URL: https://github.com/nodejs/node/pull/27243 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-05-05assert: refine assertion messageRuben Bridgewater
This makes sure that the error message is more appropriate than before by checking closer what operator is used and which is not. It also increases the total number of lines printed to the user. PR-URL: https://github.com/nodejs/node/pull/27525 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-04-19test: do not strip left whitespace in pseudo-tty testsRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/27244 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-04-15util: highlight stack framesRuben Bridgewater
Using `util.inspect` on errors is going to highlight userland and node_module stack frames from now on. This is done by marking Node.js core frames grey and frames that contain `node_modules` in their path yellow. That way it's easy to grasp what frames belong to what code. PR-URL: https://github.com/nodejs/node/pull/27052 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-04-13tools: python: ignore instead of select flake8 rulesRefael Ackermann
PR-URL: https://github.com/nodejs/node/pull/25614 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2019-03-21repl: check colors with .getColorDepth()Vladislav Kaminsky
PR-URL: https://github.com/nodejs/node/pull/26261 Fixes: https://github.com/nodejs/node/issues/26187 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-03-21readline: support TERM=dumbVladislav Kaminsky
When TERM=dumb and .isTTY=true don't use ANSI escape codes and ignore all keys, except 'escape', 'return' and 'ctrl-c'. PR-URL: https://github.com/nodejs/node/pull/26261 Fixes: https://github.com/nodejs/node/issues/26187 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-03-21console: don't use ANSI escape codes when TERM=dumbVladislav Kaminsky
PR-URL: https://github.com/nodejs/node/pull/26261 Fixes: https://github.com/nodejs/node/issues/26187 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-03-19tty: add NO_COLOR and FORCE_COLOR supportRuben Bridgewater
This adds support to enforce a specific color depth by checking the `FORCE_COLOR` environment variable similar to `chalk`. On top of that we also add support for the `NO_COLOR` environment variable as suggested by https://no-color.org/. PR-URL: https://github.com/nodejs/node/pull/26485 Refs: https://github.com/nodejs/node/pull/26248 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-03-05tty: add hasColors functionRuben Bridgewater
This adds a small wrapper around the `getColorDepth` function to check if the stream supports at least a specific amount of colors. This is convenient as the other API is not as straight forward and most use cases likely only want to know if a specific amount of colors is supported or not. PR-URL: https://github.com/nodejs/node/pull/26247 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2019-03-03tty: improve color detectionRuben Bridgewater
1) Using `process.env.TERM = 'dumb'` should never return any colors. 2) `process.env.TERM = 'terminator'` supports 24 bit colors. 3) Add support for `process.env.TERM = 'rxvt-unicode-24bit'` 4) `Hyper` does not support true colors anymore. It should fall back to the xterm settings in regular cases. 5) `process.env.COLORTERM = 'truecolor'` should return 24 bit colors. PR-URL: https://github.com/nodejs/node/pull/26264 Refs: https://github.com/nodejs/node/pull/26261 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-03test: always activate colors if necessaryRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/26264 Refs: https://github.com/nodejs/node/pull/26261 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-11test: add assert test for position indicatorRich Trott
This test adds coverage for a ternary in assertion_error.js that checks if stderr is a TTY. PR-URL: https://github.com/nodejs/node/pull/26024 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-01-27test: remove unused uncaughtException handlerAnna Henningsen
This has been unused since cbc3ef64ceaf95ec1. Refs: https://github.com/nodejs/node/pull/23053 PR-URL: https://github.com/nodejs/node/pull/25641 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-12-17doc,lib,test: capitalize comment sentencesRuben Bridgewater
This activates the eslint capitalize comment rule for comments above 50 characters. PR-URL: https://github.com/nodejs/node/pull/24996 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-11test: prepare test/pseudo-tty/testcfg.py Python 3cclauss
PR-URL: https://github.com/nodejs/node/pull/24887 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-12-06test: prepare test/pseudo-tty/testcfg.py for Python 3cclauss
PR-URL: https://github.com/nodejs/node/pull/24791 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-11-29console: lazy load process.stderr and process.stdoutJoyee Cheung
This patch: - Refactors the Console constructor: moves the property binding code into and the writable streams binding code into two methods defined on the Console.prototype with symbols. - Refactors the global console creation: we only need to share the property binding code from the Console constructor. To bind the streams we can lazy load `process.stdio` and `process.stderr` so that we don't create these streams when they are not used. This significantly reduces the number of modules loaded during bootstrap. Also, by calling the refactored-out method directly we can skip the unnecessary typechecks when creating the global console and there is no need to create a temporary Console anymore. - Refactors the error handler creation and the `write` method: use a `kUseStdout` symbol to tell the internals which stream should be loaded from the console instance. Also put the `write` method on the Console prototype so it just loads other properties directly off the console instance which simplifies the call sites. Also leaves a few TODOs for further refactoring of the console bootstrap. PR-URL: https://github.com/nodejs/node/pull/24534 Reviewed-By: Gus Caplan <me@gus.host>
2018-11-19test: use print() function on both Python 2 and 3cclauss
PR-URL: https://github.com/nodejs/node/pull/24485 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-11-13test: assert diff no colorFlorin-Daniel BÎLBÎE
PR-URL: https://github.com/nodejs/node/pull/24181 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-10test: fix uses of deprecated assert.fail with multiple argsivan.filenko
PR-URL: https://github.com/nodejs/node/pull/23673 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-10test: use assert.strictEqual instead of assert.equalivan.filenko
PR-URL: https://github.com/nodejs/node/pull/23673 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-10-16tools,test: cleanup and dedup codeRefael Ackermann
* Hoist common code to base class (`GetTestStatus`, and the `section` property to `TestConfiguration`) * Replace ListSet with the built in set * Remove ClassifiedTest * Inline PrintReport * How cases_to_run are filtered PR-URL: https://github.com/nodejs/node/pull/23251 Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-10-04test: add stdin writable regression testAnna Henningsen
Make sure that `process.stdin.write()`, and in particular ending the stream, works. PR-URL: https://github.com/nodejs/node/pull/23053 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-04process: allow reading from stdout/stderr socketsAnna Henningsen
Allow reading from stdio streams that are conventionally associated with process output, since this is only convention. This involves disabling the oddness around closing stdio streams. Its purpose is to prevent the file descriptors 0 through 2 from being closed, since doing so can lead to information leaks when new file descriptors are being opened; instead, not doing anything seems like a more reasonable choice. Fixes: https://github.com/nodejs/node/issues/21203 PR-URL: https://github.com/nodejs/node/pull/23053 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-04tools: allow input for TTY testsAnna Henningsen
Since faking TTY input is not otherwise fake-able, we need support in the test runner for it. PR-URL: https://github.com/nodejs/node/pull/23053 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-04Revert "tty: make _read throw ERR_TTY_WRITABLE_NOT_READABLE"Anna Henningsen
This reverts commit 91eec00ca20a54b1dc010cfc2fb34bc2f39eab6b. Refs: https://github.com/nodejs/node/pull/21654 Refs: https://github.com/nodejs/node/issues/21203 PR-URL: https://github.com/nodejs/node/pull/23053 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-04test: add process.stdin.end() TTY regression testMatteo Collina
PR-URL: https://github.com/nodejs/node/pull/23051 Fixes: https://github.com/nodejs/node/issues/22814 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: George Adams <george.adams@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-27assert: switch `inputs` to `values`Ruben Bridgewater
The wording seems clearer when using `values` instead of `inputs`. PR-URL: https://github.com/nodejs/node/pull/23056 Refs: https://github.com/nodejs/node/issues/22763 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-09-26test: remove unnecessary assertionsAnna Henningsen
It’s not necessary to assert that the internal `hasRef()` method exists, since it is always called directly afterwards in these tests. Furthermore, the test is overly specific, in that it expects them on a specific position in the prototype chain. PR-URL: https://github.com/nodejs/node/pull/23040 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-08-29tty: make process.binding('tty_wrap') internalcjihrig
PR-URL: https://github.com/nodejs/node/pull/22477 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-08-27src: move process.binding('async_wrap') internalDaniel Bevenius
This commit makes the async_wrap builtin an internal builtin, and changes usage of the builtin from using process.binding('async_wrap') to use internalBinding instead. Refs: https://github.com/nodejs/node/issues/22160 PR-URL: https://github.com/nodejs/node/pull/22469 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-22tty: make _read throw ERR_TTY_WRITABLE_NOT_READABLEMatteo Collina
This change avoid an 'read ENOTCONN' error introduced by libuv 1.20.0 when trying to read from a TTY WriteStream. Instead, we are throwing a more actionable ERR_TTY_WRITABLE_NOT_READABLE. Fixes: https://github.com/nodejs/node/issues/21203 PR-URL: https://github.com/nodejs/node/pull/21654 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-19stream: move process.binding('stream_wrap') to internalBindingJames M Snell
PR-URL: https://github.com/nodejs/node/pull/22345 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-08-10stream: fix readable behavior for highWaterMark === 0Denys Otrishko
Avoid trying to emit 'readable' due to the fact that state.length is always >= state.highWaterMark if highWaterMark is 0. Therefore upon .read(0) call (through .on('readable')) stream assumed that it has enough data to emit 'readable' even though state.length === 0 instead of issuing _read(). Which led to the TTY not recognizing that someone is waiting for the input. Fixes: https://github.com/nodejs/node/issues/20503 Refs: https://github.com/nodejs/node/pull/18372 PR-URL: https://github.com/nodejs/node/pull/21690 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-08-04assert: multiple improvementsRuben Bridgewater
1) Switched + / - and red / green in diffs. It seems like that style is more natural to most people. 2) Short primitives do not use the diff anymore. Especially short numbers can be read well like 1 !== 2. Cases that can not be displayed like that (e.g., -0 and +0) use the regular diff output. 3) Improved error descriptions. It was not always clear what the messages stood for. That should now be resolved. 4) Added a position indicator for single lines in case a tty is used and the line is shorter than the visual columns. 5) Color detection is now done by checking stderr instead of stdout. PR-URL: https://github.com/nodejs/node/pull/21628 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-07-31tools,test: remove unused config hooksJon Moss
Removes a couple of unused/empty functions inside of `tools/test.py` PR-URL: https://github.com/nodejs/node/pull/22010 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-06-01test: check TTY mode reset on exitAnna Henningsen
Before PR 20592, closing all handles associated with the main event loop would also mean that `uv_tty_reset_mode()` can’t function properly because the corresponding FDs have already been closed. Add regression tests for this condition. Refs: https://github.com/nodejs/node/issues/21020 Refs: https://github.com/nodejs/node/pull/20592 PR-URL: https://github.com/nodejs/node/pull/21027 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-04src: remove `kFlagNoShutdown` flagAnna Henningsen
This was originally introduced in 3446ff417ba1e, in order to fix a hard crash. However, since the libuv 1.18.0 update, that hard crash is gone, and since f2b9805f85d3f we do not throw an error in JS land anymore either, rendering the flag unnecessary. Also, the original test that checked this condition was added to `test/parallel/`. Since that typically runs without a TTY stdin, a duplicate test is being added to the pseudo-tty test suite in this commit. Refs: https://github.com/nodejs/node/commit/3446ff417ba1e11d35d1661b8788eac5af029360 Refs: https://github.com/nodejs/node/commit/f2b9805f85d3ff770892b37944a0890e0e60ca78 Refs: https://github.com/libuv/libuv/commit/0e2814179c9903423d058b095e84f48fcfb8f3d1 PR-URL: https://github.com/nodejs/node/pull/20388 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>