Live data from Hacker News

Grc - it's like stylesheets for your terminal

wynnnetherland.com

1–10 of 39 posts

Re: Grc - it's like stylesheets for your terminal

#3
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.

Re: Grc - it's like stylesheets for your terminal

#4
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've recently seen a system that can 'record' your terminal session for replay on the Web - http://ascii.io/ - whose 'recorder' forks off a psuedo terminal for this (https://github.com/sickill/ascii.io-cli/blob/master/bin/asci...). Would something like Grc use a similar approach or is there another way?

Re: Grc - it's like stylesheets for your terminal

#5
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.

http://www.youtube.com/watch?v=u5_44vs1WvY

Re: Grc - it's like stylesheets for your terminal

#7
post #6

I misread the title "it's like cheat sheets 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?

You're probably looking for cheat. http://cheat.errtheblog.com/

Re: Grc - it's like stylesheets for your terminal

#9

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've recently seen a system that can 'record' your terminal session for replay on the Web - http://ascii.io/ - whose 'recorder' forks off a psuedo terminal for this ( https://github.com/sickill/ascii.io-cli/blob/master/bin/asci... ). Would somet…

This script inserts terminal escape sequences into text. These sequences are just text that the terminal interpret as color transitions.

Ascii.io transforms these terminal escape sequences into html/css, so Grc should work fine with it.

Re: Grc - it's like stylesheets for your terminal

#10

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've recently seen a system that can 'record' your terminal session for replay on the Web - http://ascii.io/ - whose 'recorder' forks off a psuedo terminal for this ( https://github.com/sickill/ascii.io-cli/blob/master/bin/asci... ). Would somet…

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).

Post reply on HN