This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Need way to disable REPL ANSI escape codes #5344
Comments
The coffee-script repl is not managed by Node. If you run node itself in a dumb terminal, it should not send ansi codes. If you set NODE_NO_READLINE then it also will not do anything fancy with control chars. |
Hm. My mistake, if TERM=dumb, it still sends color codes. So, that's a bug. |
👍 |
I'm running node v0.12.2 on Mac OS X 10.9.5, inside a bash instance inside emacs (Ok, make fun of me). I am still getting (color) escape codes, I think?? tmp 509 $ echo $NODE_DISABLE_COLORS |
silverwind
pushed a commit
to nodejs/node
that referenced
this issue
Sep 22, 2015
This change stops the REPL from using ANSI control codes for colours when the TERM environment variable is set to "dumb". "dumb" is the terminal type with the smallest set of capabilities as described by terminfo. See: http://invisible-island.net/ncurses/terminfo.ti.html#toc-_Specials Related: nodejs/node-v0.x-archive#5344 Related: nodejs/node-v0.x-archive#25506 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Roman Reiss <[email protected]> PR-URL: #2712
rvagg
pushed a commit
to nodejs/node
that referenced
this issue
Sep 22, 2015
This change stops the REPL from using ANSI control codes for colours when the TERM environment variable is set to "dumb". "dumb" is the terminal type with the smallest set of capabilities as described by terminfo. See: http://invisible-island.net/ncurses/terminfo.ti.html#toc-_Specials Related: nodejs/node-v0.x-archive#5344 Related: nodejs/node-v0.x-archive#25506 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Roman Reiss <[email protected]> PR-URL: #2712
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The repl.js module needs to be smarter about how it sends ansi escape codes. For example if I run "coffee -i" (a command which uses the standard repl module) inside a dumb terminal that doesn't support ansi escape sequences, I see the following:
This is ugly! Those ansi escape codes are unnecessary. Furthermore the repl module is not respecting the fact that I set NODE_NO_READLINE=1 to try and get rid of those escape codes. Because I'm running the coffee command, I do not have the ability to pass the "terminal: false" parameter to the repl.start() function so I have no way of making these codes go away.
Therefore I propose:
The text was updated successfully, but these errors were encountered: