GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — repl: don't use tty control codes when $TERM is set to "dumb" by saljam · Pull Request #2712 · nodejs/node

Conversation

@saljam

@saljam saljam commented Sep 5, 2015

Copy link
Copy Markdown
Contributor

This stops the REPL from using ANSI control codes on terminals
which don't support them. (Fixes nodejs/node-v0.x-archive#5344)

For history see nodejs/node-v0.x-archive#25506

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ChALkeR ChALkeR added the repl Issues and PRs related to the REPL subsystem. label Sep 5, 2015
@rvagg
rvagg force-pushed the master branch from 11c25c2 to ba02bd0 Compare September 6, 2015 11:55
@silverwind silverwind mentioned this pull request Sep 6, 2015
A weird commit from 1970 #2713
Closed
@silverwind

silverwind commented Sep 6, 2015

Copy link
Copy Markdown
Contributor

@saljam sorry about this, but could rebase this PR once against current master?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@saljam

saljam commented Sep 6, 2015

Copy link
Copy Markdown
Contributor Author

Eh, I'm a little confused about what just happened. But sure, I just rebased. :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Sep 6, 2015

Copy link
Copy Markdown
Contributor

We had a happy little issue (#2713) which led us to force-pushing a few commits on top of master, and as your PR was based on one of the commits that was gone, it could no longer apply. The Github UI bugging out is another result of that.

Also, CI of this PR here: https://ci.nodejs.org/job/node-test-pull-request/258/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Sep 8, 2015

Copy link
Copy Markdown
Contributor

I think this is pretty low-risk, but could you add a test?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented Sep 8, 2015

Copy link
Copy Markdown
Contributor

I can foresee a problem here. terminal controls a bunch of different things, and not just ANSI control codes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@saljam

saljam commented Sep 13, 2015

Copy link
Copy Markdown
Contributor Author

@Fishrock123 as far as I can tell, it also disables readline and the up-down-arrow history.

Do we want readline on dumb terminals? If yes, I could just disable opts.useColors instead. (I have a vague memory of there being a reason I didn't do that, but that was over two years ago and I can't see why not now.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@saljam

saljam commented Sep 13, 2015

Copy link
Copy Markdown
Contributor Author

OK, I've switched to disabling useColor when TERM=dumb and added a basic test.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented Sep 13, 2015

Copy link
Copy Markdown
Contributor

LGTM. @saljam could you put a link into the commit log, and/or a comment in the code, to a reference on env.TERM? (i.e. if there is any sort of spec that defines it or something.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@saljam
repl: don't use tty control codes when $TERM is set to "dumb"
c156277
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.
http://invisible-island.net/ncurses/terminfo.ti.html#toc-_Specials

Fixes nodejs/node-v0.x-archive#5344
@saljam

saljam commented Sep 13, 2015

Copy link
Copy Markdown
Contributor Author

@Fishrock123 done. PTAL.

Git, hg, grep, &c all respect TERM=dumb, but surprisingly I couldn't find a clear definition other than in terminfo's source.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Sep 15, 2015

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ChALkeR ChALkeR mentioned this pull request Sep 17, 2015
tty: no readline when TERM==dumb nodejs/node-v0.x-archive#25506
Closed
silverwind pushed a commit that referenced this pull request Sep 22, 2015
@saljam @silverwind
repl: don't use tty control codes when $TERM is set to "dumb"
ccea33d
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
@silverwind

silverwind commented Sep 22, 2015

Copy link
Copy Markdown
Contributor

Landed with some fixups to the test in ccea33d.

I added a more helpful error message to the asserts and fixed the linter issues. @saljam please run make jslint next time before committing ;)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind silverwind closed this Sep 22, 2015
@saljam

saljam commented Sep 22, 2015

Copy link
Copy Markdown
Contributor Author

Thanks! And noted, somehow I convinced myself make test included a jslint
run.

On Tue, 22 Sep 2015 20:44 silverwind [email protected] wrote:

Landed with a few fixes to the test in ccea33d
ccea33d
.

I added a slightly more helpful error message to the asserts and fixed the
linter errors. @saljam https://github.com/saljam please run make jslint
next time before committing ;)

—
Reply to this email directly or view it on GitHub
#2712 (comment).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Sep 22, 2015

Copy link
Copy Markdown
Contributor

@saljam it does include linting, and should've shown these errors after the test run.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@saljam

saljam commented Sep 22, 2015

Copy link
Copy Markdown
Contributor Author

In which case whoops! Sorry! (I can confirm it does work.)

On Tue, 22 Sep 2015 20:52 silverwind [email protected] wrote:

@saljam https://github.com/saljam it does

node/Makefile

Lines 89 to 92 in ccea33d

test: | cctest # Depends on 'all'.
$(PYTHON) tools/test.py --mode=release message parallel sequential -J
$(MAKE) jslint
$(MAKE) cpplint

include linting, and should've shown these errors after the test run.

—
Reply to this email directly or view it on GitHub
#2712 (comment).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rvagg pushed a commit that referenced this pull request Sep 22, 2015
@saljam @rvagg
repl: don't use tty control codes when $TERM is set to "dumb"
9760e04
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 rvagg mentioned this pull request Sep 22, 2015
Release proposal: v4.1.1 #2995
Merged
@j3pic j3pic mentioned this pull request Feb 18, 2019
Nodejs STILL sends ANSI escape sequences to dumb terminals. #26187
Closed
@snyk-bot snyk-bot mentioned this pull request Apr 30, 2023
[Snyk] Security upgrade karma from 1.3.0 to 2.0.0 aliscco/alisco-node#393
Open
@aliscco aliscco mentioned this pull request Apr 16, 2024
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1396
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@saljam @silverwind @Fishrock123 @ChALkeR
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.