PlatformIO IDE is a nifty integrated development environment available in Atom for embedded systems. It supports many different boards and platforms out of the box. PlatformIO Terminal is a terminal package for Atom that can be installed independently of the IDE.

The terminal comes with some basic theme support. This short note explains how to configure it for the Solarized colours. Other themes may be configured similarly.

Themes in PlatformIO Terminal

demo

The builtin themes of PlatformIO Terminal only modify the foreground, background, and cursor colours. The themes can be reached through the Settings ➡︎ Packages ➡︎ Platformio Ide Terminal ➡︎ Styles menu.

The problem is that these themes are more or less useless with the 16 default ANSI colours that define how text will be diplayed in the terminal. The defult colours are ugly to say the least, and completely unreadable at times.

The terminal does not include the Solarized themes by default. It is fairly straightforward to add them though.

Add Basic Theme Files

Create the basic theme files solarized-light.less and solarized-dark.less under ~/.atom/packages/platformio-ide-terminal/styles/themes

// solarized-light.less
.solarized-light {
  background-color: #fdf6e3;
  color: #657b83;

  ::selection {
    background-color: #93a1a1;
  }

  .terminal-cursor {
    background-color: #586e75;
  }
}
// solarized-dark.less
.solarized-dark {
  background-color: #042029;
  color: #708284;

  ::selection {
    background-color: #475B62;
  }

  .terminal-cursor {
    background-color: #819090;
  }
}

Import Basic Theme Files

Import the basic theme files by adding the following two lines into ~/.atom/packages/platformio-ide-terminal/styles/themes.less

@import 'themes/solarized-dark';
@import 'themes/solarized-light';

Define the ANSI Colours

The specific colours are added to ~/.atom/config.cson under the section platformio-ide-terminal. For example, for Solarized Light, the section looks as below.

"platformio-ide-terminal":
    ansiColors:
      normal:
        black: "#003541"
        blue: "#268bd2"
        cyan: "#2aa198"
        green: "#859901"
        magenta: "#d33682"
        red: "#dc322f"
        white: "#eee8d5"
        yellow: "#b58901"
      zBright:
        brightBlack: "#fdf6e3"
        brightBlue: "#657b83"
        brightCyan: "#586e75"
        brightGreen: "#93a1a1"
        brightMagenta: "#073642"
        brightRed: "#eee8d5"
        brightWhite: "#002b36"
        brightYellow: "#839496"
    core:
      iconColors:
        blue: "#0433ff"
      scrollback: 10000
    style:
      theme: "solarized-light"

For solarized-dark, only the zBright section has to be changed, and the theme has to be set to solarized-dark.

// for solarized-dark
zBright:
brightBlack: "#002833"
brightRed: "#cb4b16"
brightGreen: "#586e75"
brightYellow: "#657b83"
brightBlue: "#839496"
brightMagenta: "#6c6ec6"
brightCyan: "#93a1a1"
brightWhite: "#fdf6e3"

Add Menu Entries

To enable selection of the themes from the Settings UI, add the entries for the Solarized themes in ~/.atom/packages/platformio-ide-terminal/lib/platformio-ide-terminal.coffee. For example the complete enum may look like below.

enum: [
  'standard',
  'inverse',
  'linux',
  'grass',
  'homebrew',
  'man-page',
  'novel',
  'ocean',
  'pro',
  'red',
  'red-sands',
  'silver-aerogel',
  'solarized-dark',
  'solarized-light',
  'solid-colors',
  'dracula',
  'one-dark',
  'christmas',
  'predawn'
]

Restart Atom

Restart Atom and enjoy your new fancy terminal with pleasing colours!

Solarized Light Terminal

Blog Comments powered by Disqus.

Next Post Previous Post