Boss your terminal. Hard

Luke Phyall
Shoreditch Warlock
Published in
6 min readMar 17, 2019
Legendary terminal. 0 failures. 100% test coverage. This is the Way of the Code Jack.

Do you want an amazing terminal that is both helpful to read, use, and smartly responds to a summons from wherever you are?

Do you hate your tiny bash window with a passion and resent every moment that you have to spend hunting after it with mouse or track pad?

Do you want to look like a legend who knows what they’re doing with a development environment that bellows, “I’ve been customised to within an inch of my electronic life in ways that normal humans simply don’t know is possible?”

Of course you do.

However, terminal customisation might initially have struck you as something of a dark art, because your terminal is where your command line lives, and everybody knows that the command line is frankly witchcraft.

Fear not, code jack; the Warlock has you.

What follows is an instructional for the most junior of junior developers that will walk you through changing your command line into something positively friendly, with some additional functionality that will make your terminal materialise like a TV licence inspector on the one day off from work you’ve booked in six months.

First thing is to follow this link. This is an excellent article that will take you through the bulk of the customisation and leave you with a command line electronically-daubed in glorious technicolour. The gist of it is: install iTerm, change your default shell to zsh, install the oh-my-zsh theme, then stick the Spaceship prompt on there (the Spaceship bit being optional). Do that now. It’s easier than you think, just don’t get daunted.

On my first day at Makers, we were supplied with loaner Macs. I was lucky, in that I’d had the use of a brand new Macbook for three of the four weeks of the precourse; the conversion from Windows to Mac OS is not an insignificant matter. As an amount of tinkering had already happened on the machine I’d been using, I was somewhat eager to know if I’d be able to set these loaners up just the same.

I put the question the head coach.

“How much customisation is acceptable on the loaner Macs?”, says I.

“As much as you want,” says he.

Prepare for glory, Loaner Mac.

Alice was sitting in on that particular Day One session, and this question set her off. She let us know really rather assertively that not only can you customise your laptop, you very much should. Your laptop is the tool via which you interact with your code, and interacting with code is now (or very soon will be) your job. She told us that your laptop should work for you and not the other way around. She even held her Mac over her head like a little metal roof at one point*.

So listen to Ed; listen to Alice. Your Mac works for you now, which means that using it should be a low-friction experience. What’s purple, sits in the corner and whirs?

My Mac, and I’ll paint it any colour I like.

By following the walkthrough in the above link, you should now have dealt with the functionality of your terminal. Now, we deal with the presentation.

Start iTerm, and go to Preferences. It’s in the top left of your screen; click the bit that says ‘iTerm2’.

Click ‘Profiles’, third tab from the left:

You’ve probably only got one profile in there, called Default with a star next to it. It’s fine to edit this one, but if you’d rather you can create an additional profile by click the plus at the bottom. Click the Window tab:

This is where the magic actually happens. On the right is the Style dropdown. Inside that are four options that’ll make the terminal appear from your chosen direction. My personal preference is ‘Full Width Top of Screen’, which makes your terminal drop down from the top like a visor, but it can be set to come from any of the four cardinal directions. Play with these settings and adjust to suit:

To determine how for down (or up) your terminal comes, change the Rows figure. Thirty five is about right for me on the laptop screen; fifty when it’s connected to a monitor. If you’ve chosen to have your terminal fly out at you from the left or right, change the Column figure instead:

The last step is to be able to summon your new visor-style terminal with a keyboard shortcut. Go to the Keys tab. Tick the ‘Open hotkey window’ box at the bottom and click the ‘Configure hotkey button’ to the right of it:

Here you can record any combination of keys you want as a shortcut to summon the terminal. I have two — one for two-handed operation (if I’m already typing), and another for single-handed (if I’m sitting just staring at the screen). First, click inside the Hotkey box (the upper red box). It should go blank. Next, press any combination of keys you want to summon your terminal. That combination will be shown on the screen for you. If you want to set up additional hotkeys like mine, click the highlighted box at the bottom:

In the next screen, click the add button. A box will appear saying “Click to set”. Click inside it, press your desired combination, and click Ok:

You’re done. If you’ve got a terminal window open, type ‘exit’ and press your new hotkey combination. Your newly-configured terminal will come storming out of the wings ready, willing and able, and vanishes into the aether just as quickly.

One more thing before you go. You might find that with your current settings, the summoned terminal visor appears in whatever desktop you’re currently focused on. I use multiple desktops; my text editor is on one, Brave will be on another, my Notes app on a third. Rather than minimising everything to keep it all stacked up on one screen, I keep everything segregated and cut between them using Ctrl + left/right. However, I always want my terminal to open over whatever screen my editor is on when I use my hotkey, and for the desktop focus to automatically switch back to it. Play with the settings of Screen:

I have Atom assigned to “Desktop on Display 2” (if you right click on any icon on your dock you’ll see Options, which will give you a flyout). Changing the terminal Screen setting to Screen 2 means that iTerm will always open over my editor, whenever I have a second display plugged in.

*This was to illustrate that your laptop should never be something you work under. It was not raining.

--

--

Luke Phyall
Shoreditch Warlock

Junior dev currently training at Makers Academy in London.