Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Need way to disable REPL ANSI escape codes #5344

Closed
@jart

Description

@jart

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:

^[[1G^[[0Jcoffee> ^[[9G

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:

  1. If NODE_NO_READLINE is set, repl will not print ansi codes.
  2. If process.env['TERM'] is 'dumb' then repl will not print ansi codes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions