Tldr: How to get colors?

Created on 1 Feb 2017  路  16Comments  路  Source: tldr-pages/tldr

I installed by: sudo npm install -g tldr
But it's only black & white. How can I get colors??

clients

All 16 comments

The instructions linked by @agnivade should solve this issue, but please confirm if not and we'll investigate further.

Thanks for your help. Sorry for asking in the wrong place. So I downloaded https://raw.githubusercontent.com/tldr-pages/tldr-node-client/master/config.json to $HOME/.tldrrc but I still have no colors. I do have some italics (which I've never seen on my terminal) but I had those before copying as well. It doesn't seem to make any difference... Is there another client you can recommend?

You have to change the "theme" variable to a different one to get colors. Choose from "base16", "ocean" or "matrix". All of this is already mentioned in the link. Let me know if its still confusing.

OK, gotcha. This indeed works. I have now also installed the C++ client and the bash client, and I guess they all have different locations for their colors..? The C++ one worked out of the box with color.

Yes, each client has their own defaults (which is one of the reasons it makes sense to have multiple clients).

I guess most of then build a pages cache in different locations as well.

@agnivade I stumbled across this because I am also not getting colors at all even when using the themes.

I tried these but nothing worked:

  • tldr -t ocean tar
  • Copied the example from here and ran both tldr tar and tldr -t ocean tar

How can I help debug?

hey @kaushalmodi - sorry this slipped under my radar.

Can you verify you are using latest tldr (tldr --version) ?

@agnivade Thanks for the follow up. At the time of posting that comment, I had freshly installed tldr using npm install -g tldr. But since it didn't work, I uninstalled it. Unfortunately I didn't record the version of tldr then.

I re-installed it and now it is working with tldr -t ocean tar. The version is 2.0.1.

Thanks!

Cool.

On a side note, you uninstalled a tool just because its theming didn't work ?

@agnivade

you uninstalled a tool just because its theming didn't work?

Nope, not just that; because I found an equivalent client that works great from within emacs. But not that your app works from the terminal, I'll keep it too :)

@agnivade @waldyrious I also tried adding [(.tldrrc.json) or (.tldrrc.sh) or (.tldrrc) <--tried all of them] file in HOME directory in which below code is written. I'm on 3.3.2 version, v12.18.0 node version also I'm on fedora32 using Terminal(bash).
I installed tldr using sudo npm install -g tldr && tldr --update
Please help me. 5 Attachments added

### {
    "pagesRepository": "https://github.com/tldr-pages/tldr",
    "repository": "https://tldr-pages.github.io/assets/tldr.zip",
    "themes": {
      "simple": {
        "commandName": "bold, underline",
        "mainDescription": "bold",
        "exampleDescription": "",
        "exampleCode": "",
        "exampleToken": "underline"
      },
      "base16": {
        "commandName": "bold",
        "mainDescription": "",
        "exampleDescription": "green",
        "exampleCode": "red",
        "exampleToken": "cyan"
      },
      "ocean": {
        "commandName": "bold, cyan",
        "mainDescription": "green",
        "exampleDescription": "green",
        "exampleCode": "cyan",
        "exampleToken": "dim"
      },
      "inverse": {
        "commandName": "bold, inverse",
        "mainDescription": "inverse",
        "exampleDescription": "black",
        "exampleCode": "inverse",
        "exampleToken": "green, bgBlack, inverse"
      },
      "myOwnCoolTheme": {
        "commandName": "bold, red",
        "mainDescription": "white",
        "exampleDescription": "underline, green",
        "exampleCode": "blue",
        "exampleToken": "inverse, magentaBright"
      },
      "matrix": {
        "commandName": "bold",
        "mainDescription": "underline",
        "exampleDescription": "green, bgBlack",
        "exampleCode": "green, bgBlack",
        "exampleToken": "green, bold, bgBlack"
      }
    },
    "theme": "myOwnCoolTheme"
  }

Screenshot from 2020-06-09 22-59-35
Screenshot from 2020-06-09 23-00-39
Screenshot from 2020-06-09 23-01-01
Screenshot from 2020-06-09 23-01-44
Screenshot from 2020-06-09 23-03-49

ISSUE resolved by below command i.e. providing user while install as mentioned in the installing section https://www.npmjs.com/package/tldr/v/1.6.1
sudo npm install -g tldr --user=$root

@lfsabcd7 Glad that you managed to fix it 馃憤

Word of advice, do not install node and global npm packages using sudo, use nvm or fnm instead. It will save you a lot of headaches in the long run 馃槈

thanks @vladimyr

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dikarel picture dikarel  路  3Comments

zlatanvasovic picture zlatanvasovic  路  3Comments

mikerouxfr picture mikerouxfr  路  3Comments

michaeldbianchi picture michaeldbianchi  路  3Comments

waldyrious picture waldyrious  路  3Comments