question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unreadble output in one special case

See original GitHub issue

The content of this post is in reference to xo, but I believe that chalk is the source of the problem/issue. This was spotted as an xo issue (sindresorhus/xo#145). I traced that back to sindresorhus/eslint-formatter-pretty and now chalk.

Copy and pasted below

I’m not sure what’s special about the output from xo, but it’s the only thing that seems to be affected. I cannot read the output without copying and pasting it somewhere. Here are a few screenshots:

Normal Output

selection_2016-09-29_170518

Highlighted Output

selection_2016-09-29_170539

I’ve been copying the highlighted output my editor to read it. Any idea what xo is doing that’s unique in this way? I’ve used hundreds of other cli tools including the underlying ESLint without any problems. I’ve used dozens of other programs that use chalk to print colorized output. I’ve even tried changing my local color profiles to no avail. Any help would be greatly appreciated.

For Reference

xo | tee makes the output visible although not colorized.

This is the content of the hidden output in both screenshots:

➜  ava git:(add-test-run-duration) xo

  api.js:183:2
  ⚠  183:2  Unexpected todo comment.                                          no-warning-comments

  lib/assert.js:15:1
  ⚠   15:1  This function has too many parameters (5). Maximum allowed is 4.  max-params

  lib/logger.js:94:2
  ⚠   94:2  Unexpected todo comment.                                          no-warning-comments

  lib/reporters/mini.js:178:4
  ⚠  178:4  Unexpected todo comment.                                          no-warning-comments
  ⚠  305:1  Unexpected todo comment.                                          no-warning-comments

  lib/test.js:42:2
  ⚠   42:2  Unexpected todo comment.                                          no-warning-comments

  test/cli.js:96:3
  ⚠   96:3  Unexpected todo comment.                                          no-warning-comments
  ⚠  141:3  Unexpected todo comment.                                          no-warning-comments

  test/promise.js:129:1
  ⚠  129:1  Unexpected todo comment.                                          no-warning-comments

  9 warnings

System Information

OS: Ubuntu 16.04 x64 Terminal: Byobu terminal $TERM: screen-256color $SHELL: /usr/bin/zsh [ -t 1 ] && echo yes || echo no: yes

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
paulmolluzzocommented, Jan 20, 2017

In case anyone else finds this post, first test your terminal emulator.

echo -e “Normal \e[8mHidden \e[28mNormal”

For anyone who’s made it this far down the rabbit hole and is seeing only the first Normal in the test listed above, see this Q/A for fixes.

It took some playing for me to get this working, and in the end I aliased tmux to TERM=screen-256color-bce tmux. I already had set -g default-terminal "screen-256color" in my .tmux.conf file.

3reactions
gunarcommented, Dec 14, 2016

In case anyone else finds this post, first test your terminal emulator.

echo -e "Normal \e[8mHidden \e[28mNormal"

should print hidden style

source

Read more comments on GitHub >

github_iconTop Results From Across the Web

Non Printable & Special Characters: Problems and how to ...
We make an attempt to print all ASCII characters to examine their effects. The SAS code used to generate the below output (Output...
Read more >
<%= debug(controller) %> produces unreadable output - Stack ...
In one of my templates I want to take a closer look at the controller object using the debug() helper. It is said...
Read more >
windows 7 console tekst is unreadable cause of special chars
The output is messed up because of colors. This is when I'm using AWS Codepipeline (Ubuntu machine). I believe there was a NO_COLORS...
Read more >
SRFI 243: Unreadable Objects - Scheme SRFI - Schemers.org
The point of unreadable objects is that the Scheme reader cannot read them. Nevertheless it can be useful for a special-purpose reader to...
Read more >
22.3.1. Output to Character Streams
If *print-readably* is true, print-unreadable-object signals an error of type print-not-readable without printing anything. The object, stream, type, and id ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found