Instantly share code, notes, and snippets.

What would you like to do?
Set up Chrome Secure Shell to handle solarized terminal colors
// Disable bold.
term_.prefs_.set('enable-bold', false)
// Use this for Solarized Dark
term_.prefs_.set('background-color', "#002b36");
term_.prefs_.set('foreground-color', "#839496");
term_.prefs_.set('color-palette-overrides', [
# !!! CARGO CULTED !!!!
# Author: (Benjamin Staffin)
# Set your terminal's color palette to match the Solarized color scheme by
# using escape sequences. Uses OSC 4 to set colors.
# This will work with many terminal emulators, but not all.
set -o nounset
# This next line would set the colors in the 256 color pallette which normally approximate
# solarized. Not a universal solution, but it helps with getting vim to look
# right! Stick this in your .vimrc just before "colorscheme solarized":
# let g:solarized_termtrans=1
# let g:solarized_termcolors=256
# See for more information.
printf '\x1B]4;234;rgb:00/2b/36;235;rgb:07/36/42;240;rgb:58/6e/75;241;rgb:65/7b/83;244;rgb:83/94/96;245;rgb:93/a1/a1;254;rgb:ee/e8/d5;230;rgb:fd/f6/e3;136;rgb:b5/89/00;166;rgb:cb/4b/16;160;rgb:dc/32/2f;125;rgb:d3/36/82;61;rgb:6c/71/c4;33;rgb:26/8b/d2;37;rgb:2a/a1/98;64;rgb:85/99/00\a'
function cset() {
printf "\x1b]4;$ANSI;rgb:${RGB}\a"
cset 0 $base02
cset 8 $base03
cset 1 $red
cset 9 $orange
cset 2 $green
cset 10 $base01
cset 3 $yellow
cset 11 $base00
cset 4 $blue
cset 12 $base0
cset 5 $magenta
cset 13 $violet
cset 6 $cyan
cset 14 $base1
cset 7 $base2
cset 15 $base3

This comment has been minimized.

njbair commented Aug 11, 2013

This is great! I've already got solarized installed on my workstation shell, so all I had to do was open the Secure Shell extension, fire up Dev Tools, and paste the contents of prefs.js into the window.

Thanks for your work!


This comment has been minimized.

sandesh-mq commented Apr 7, 2014

Thanks :)


This comment has been minimized.

seadb commented Oct 18, 2014

How do I install it?


This comment has been minimized.

ghost commented Mar 4, 2015

brisondc@ Find the Secure Shell App, right click on it, go to options. Hit ctrl-shift-j to bring up a javascript console. Copy and paste the values from prefs.js into the console. Win!

By the way, thanks for this johnbender@


This comment has been minimized.

CJEdgerton commented May 8, 2016

@kimdouglasmason This helped me too. Thanks!


This comment has been minimized.

sricketts commented Aug 18, 2018

Thanks. This is almost working for me :)

I tried the prefs.js approach. The colors look right when I start to connect, but it looks like between Loading NaCl plugin... and done, the colors reset back to the default. I've googled all over and can't find anyone else with that problem. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment