HOM 4: Get to Know Your Terminal

Beep boop - this is a robot. A new show has been posted to TWiT…

What are your thoughts about today’s show? We’d love to hear from you!

1 Like

Awesome show @Leo. I have iTerm downloaded and ready to learn some stuff about terminal.

3 Likes

I’ma longtime Windows user and late last year finally was able to afford a MacBook Pro, the 16 inch model. I really love it and my Windows PC doesn’t get used much any more. I’m thrilled that Leo has begun this new series of shows and getting into the technical stuff. I’ve heard him speak if the Terminal so many times over the years and wondered if I would find it useful, and now I will find out! Thank you, Leo, from someone that is just about the same age as you.

1 Like

so excited while waiting for next week

How to get my iTerm to look like Leo’s? I have this long string before the command prompt.

OMG - I love the Apple ‘bong’ sound. Thank you Leo for getting it back on my 2016 MBP! Can’t wait to learn more about Terminal. Haven’t used a command line since the DOS days.

1 Like

I like the bong sound as well, but I enabled it on my iMac (home) but not on my MacAir, since I don’t want to disturb others in public.

I wonder why Apple to make the bong sound go away?

@tokyotony I confused everyone (@Jammerb says I confused him anyway) by not using the standard MacOS Terminal and the default bash shell.

As you might have seen on a previous episode I strongly prefer the free iTerm2 for my terminal.

And while you can turn your bash prompt into anything you like (cf. Bash prompt basics - LinuxConfig.org) it’s much easier if you switch to the more modern fish shell. Follow the instructions at fishshell.com to change your shell then type fish_config at the prompt to see a variety of customizations you can adopt.

Under the hood, much of fish’s power comes from its functions. Instead of using aliases, as in bash, you define a function which becomes a first-class command. Even the prompt is a function, which allows it to do a lot of work. For example my simple looking prompt changes to reflect the current directory (home is ~ $) but also is git aware, so in a git directory it will reflect the current state of the repository, e.g. ~/git/lisp (master|✔) $

Speaking of git, I keep my configuration files (for fish, emacs, mail, ssh, gpg, etc.) in a secure git (on Keybase) so that I can easily apply my setup on any new machine (Mac and Linux anyway). That’s for a more advanced HoM some day.

On Catalina the default shell is zsh, which is worlds better than bash, as well, and if you want to stay with that it’s worth investigating Oh My Zsh for customizations.

I’ll do an HoM on all this at some point. Just beware, changing from the default shell means that a lot of scripts that assume you’re using bash (also the default on Linux) will need some finagling to get working. But it’s worth it to use a more modern shell, in my opinion.

Once everyone’s comfortable with working in the shell, it’s time to unleash Emacs. :wink:

4 Likes

Mahalo Leo, this was helpful although choosing the correct link to install fish wasn’t clear to me. First tried the Homebrew link but that didn’t install fish, so I uninstalled it. Then successfully caught me fish by using the installer. None of this guides me to configure mine to appear as yours with the Apple logo on the left side. Any tips for doing that? Or did you already answer that and I missed it? Thanks again for the journey.

1 Like

Once you’ve got brew installed you can install fish by typing

brew install fish

The Apple logo is part of a sysinfo package called neofetch. Which you can install with, you guessed it

brew install neofetch

If you want neofetch to run every time you open a terminal shell, add neofetch to the end of your config.fish file. (type nano ~/.config/fish/config.fish)