Solarized provides a great mapping table between terminal color names and various color spaces.
Have to disagree slightly with this. Solarized is a great starting point, but, last time I checked, using the provided mapping table leads bold green, bold blue, and (most importantly) nonbold white to all become nearly-indistinguishable shades of grey. This alone damages the utility of the normally-colorized output of `ls`, as well as any tools that expect bold and nonbold versions of the same color to be roughly the same hue.
If you can stand losing Solarized's ability to swap back and forth between light and dark modes, I highly recommend tweaking it to your needs rather then relying on the default.
Apparently. Judging from what it does the implementation could be a nice example of layering shell tools on top of each other to get new functionality. Probably it has some uses for people that work entirely with the shell.
Meh. Because I'm a Real Man with Real Big Balls I still think terminal text should come in one of three colors: green, amber, and page white. And you choose the color when you buy the terminal.
Kidding aside, I do do all my coding in an xterm that's had the font set to Glass Tty VT220 and the color set to one of those. Text decoration for highlighting purposes is done with our old friends bold, underline, and reverse video. But I'm retro like that.
Over the years this has been a hobby of mine to colorize the shell on Linux or at least make it easier on my eyes. The best results I've had relied on the following features:
1. Screen. Screen allowed me to colorize the hardstatusline at the bottom of the page. You can also set the hardstatus line so it updates to show the open application. Watch the video at the bottom of the screen and when I open Vim and how it updates the tab name on the hardstatus line.
2. Using zsh. Zsh allows you to set the right hand prompt and its color.
3. Using Xterm. Xterm allow me to launch it with any parameters controlling font, background color, foreground color, font size etc. The font I found that work the best was "Liberation Mono".
4. Colorize the prompt. Pretty standard.
HEre is a video making use of all these features except for zsh. This was back when I used bash.
I'm sure someone here will know the answer for this off the top of their head so.. how does this work under the hood? How does it get to act as a sort of 'filter' for stdout?
I got this silly idea how to do it, I don't know if it works:
1. export your real $PATH to eg $REAL_PATH
2. clear $PATH (or set it to some dummy value)
3. Attach a wrapper script to command_not_found_handler, which would call the original command with REAL_PATH and pipes it to your filter (or colorizer or whatever).
This script inserts terminal escape sequences into text.
I understand that part. But there's a screenshot where a "ping" is being done at a normal looking terminal and it just works without being explicitly piped through a program that does the above. What's the mechanism for piping all the terminal output through another process?
I had an idea like this a while back, but as far as I know there is no shell support for it. Basically, you would install decorators in your current shell instance. The decorator could act as a filter for all stream io. Then you would not need any special commands or aliases, just configuration for how to highlight patterns.
To answer how programs like script (a little like ascii.io, but from decades ago and shipped with every Unix system), check out the manual page for forktty.
I don't give a rat ass for over coloring stuff in the terminal. I like when only what helps readability is colored.
But then again I do like some fancy stuff. And I noticed the author uses a unicode char in his prompt.
While it breaks the \$ functionality ($|#) it looks neat, and I didn't think of that.
Note that if you're an Emacs user and you execute commands from inside Emacs, there is already a framework for colorization in the fontify-* or highlight-* functions.
It uses the same idea of config files specifying what regexes to look for and how to color them. This tools looks a little more full-featured and tested though.
Also, I only thought of applying it to highlighting log files. I didn't think of using aliases to improve the appearance of regular terminal commands.
Netherland - I installed this and gave it a try. I'm running into one major issue. I can't see my prompt (or the last line in whatever I'm doing). I don't mess around and invoke grc by doing 'grc bash'. This now listens for every command that's in the config file. Well the command I want to work most of all is ssh. When I ssh into another system I don't see my prompt. Any ideas what I can do to fix this?
If you're using Terminal.app, the first thing you should do is installing an eye-friendly color theme. Check out Optometrist: https://github.com/pstadler/optometrist
I misread the title "it's like cheatsheets for your terminal" and now I can't help wondering if such thing exists. I know there is man but it doesn't exactly have a cheatsheet format. Anyone?
Does anyone have trouble with tmux displaying colours?
I tried a custom git log query that coloured the custom ordered responses. Rather than showing the text in colour, there were inline codes being displayed.
Does it work ok without tmux? If not, does git print directly to the terminal, or does it pipe to another program (like a pager)? Most programs make an isatty check in this case, but if you force printing of escape codes and pipe the output to less for example, you'll see the codes in the output instead of their effects.
Have to disagree slightly with this. Solarized is a great starting point, but, last time I checked, using the provided mapping table leads bold green, bold blue, and (most importantly) nonbold white to all become nearly-indistinguishable shades of grey. This alone damages the utility of the normally-colorized output of `ls`, as well as any tools that expect bold and nonbold versions of the same color to be roughly the same hue.
If you can stand losing Solarized's ability to swap back and forth between light and dark modes, I highly recommend tweaking it to your needs rather then relying on the default.