loading...

What’s your default terminal shell? And what do you love the most about it?

lostintangent profile image Jonathan Carter ・1 min read

Hey all! I keep meaning to give Fish a serious evaluation as my default shell, since it seems to provide enough meaningful productivity enhancements over Bash, with little-to-no setup (e.g. command auto-completions). That said, I’m curious to hear what others are using, what their exact setup is, and what they love the most about it. In particular, what things do you find actually have a significant impact on your productivity and general developer enjoyment (as opposed to just being “cool”)?

Do you primarily use Bash, Zsh, Fish, PowerShell, or something else? Do you use a framework/plugin manager such as Oh My Zsh or Fisher? Are there any particular pro-tips that you feel like everyone should know, in order to get the most out of their shell?

Feel free to share any and all details about your personal shell setup, so that we can all get inspiration to try something new, and possibly up-level our daily dev workflows! Also, bonus points if you include a screenshot/gif of your setup and favorite shell feature in action 🚀

Posted on by:

lostintangent profile

Jonathan Carter

@lostintangent

I build developer tools and services at Microsoft (currently VS Online, Live Share, IntelliCode, and Playwright, previously CodePush, IE Dev Tools, Visual Studio, Azure).

Discussion

markdown guide
 

Bash is my go to. I set it up once, and don't have to touch it. No muss, no fuss.

 

Same. I dislike some "bash-isms" and lately trying to make my scripts more portable, but I am so familiar with bash that I end up falling back to bash-specific features.

 

How do you set it up? Are you referring to roaming/setting up your aliases/etc.? Or are you using some framework like Oh My Bash?

 

I have a private repo with all my dot files, including .bashrc, with all my base aliase, global environment variables ready for assignment, etc.

Makes sense. That’s what I assumed you meant, but I just wanted to double-check 👍

 

I use Fish as my default shell when I can. I do find it jarring to log into a bash shell on a remote server and see how severely limiting it is. Fish is so good at knowing what you want to do that going back to bash feels like a major step down in productivity. I'm also not a fan of a bunch of customization to get something to work, so out of the box Fish already does a lot for you.

I did install Oh my fish with the bobthefish theme locally. The integrations with dev tools (git, virtualenv, Docker) is really helpful.

I hadn't heard of Fisher. I'll have to check that out.

 

Makes sense! It sounds like the killer feature for Fish is its autosuggestions based on history, and it’s productivity enhancements without requiring any further configuration (e.g. auto-cding to directories)

 

My default shell is Zsh. I did an interesting experiment a few days ago, i uninstalled oh-my-zsh to see if the features i use where a coming from Zsh or they were provided by oh-my-zsh and it turns out that most of them where just a configuration thing built-in in Zsh that had to be "activated."

My favorite thing of Zsh is the completion based on the commands history.

If you start typing a command like git p and press the Up arrow key Zsh will autocomplete the command with the last command you typed that begins with git p. In other words you press git p + Up and you might get git push some-branch.

This is not a default behavior, if you use oh-my-zsh it is activated. This is what they do.

# load functions
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search

# bind them to a key

# start typing + [Up-Arrow] - fuzzy find history forward
bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search

# start typing + [Down-Arrow] - fuzzy find history backward
bindkey "${terminfo[kcud1]}" down-line-or-beginning-search

# before binding they make sure terminfo isn't empty

Another one that i like is something called magic-space, this will "expand" special shell symbols like !! (which means the last command). You press !! + space and it gets autocompleted to your last command, this is useful when you forgot to use sudo before a command.

This isn't activated by default, oh-my-zsh enables it for you.

# [Space] - do history expansion
bindkey ' ' magic-space

I also found out that Zsh has a vi-mode. When enabled it kinda "breaks" some of the default behaviors but it's still cool.

Anyway i extracted all the code that i use from oh-my-zsh and put them in here if anyone is curious.

 

That’s really interesting! I’ve always found it a tad confusing to understand what Oh My Zsh actually contributed to the shell experience, and from your experiment, it seems like among other things, it introduces a bunch of opinionated config for Zsh? That’s useful to know 👍

 

Did you notice a speed up after removing oh-my-zsh in favor of the cherry picked configuration in the gist?

 

I did, it was a while ago but I remember that it felt quite snappy. I do have to say that startup time was never an issue for me when I used oh-my-zsh, the only times it got slow on startup was when checking for updates.

 

Definitely BASH; It's so easy to get up and running, without any dependencies. I took the time to sort out my dotfiles a while back, and it was a great investment that has paid off every time I move to a new machine (or do a refresh).

 

Same here.
Along with my dotfiles, I added some more tools and setups (like installing fzf - to which I am addicted).

I use this on every machine/server I use frequently.

 

thanks for the fzf recommendation, will check it out.

 

Powershell. It came with Windows and it works fine. I installed pshazz and the "Consolas Powerline" font to customize it a bit with the current git status in the command prompt, easily configurable aliases and color themes.

In my Linux VMs I use bash. I've been wanting to try zsh for some time but I never got around to do it.

 

My favorite is fish terminal because I like auto-suggestion feature. I tried to use zsh on windows, but couldn't.

 

How do you setup Fish on Windows? Installing it within WSL? Cygwin?

 

ZSH in vi-mode with Powerline. I don't use Oh my ZSH, but do make use of some of the features that are part of ZSH which it turns on by default. My biggest reason for using ZSH is the configurability it offers, including a handful of behaviors that you just can't get out of bash. Vi-mode was already the case for me back when I used bash, I've always found vi-style keybindings to be more natural for me (but I also pretty much exclusively use vim as my editor). Powerline was a recent addition, but I've loved it so far (it does a more efficient job of getting the info I want into the prompt than using a complex prompt command).

 

zsh, with oh my zsh but I don't really care about anything other than autocomplete.

 

Thanks! Out of curiosity: have you tried out Fish? It seems like it would provide you with autocomplete out-of-the-box, without needing to install anything else (e.g. Oh My Zsh). There are potential downsides as well (e.g. it isn’t POSIX-compliant), but I’m beginning to wonder if it makes sense to have a default shell for interactive use, and then another one for scripting.

 

I would try fish, thanks for recommending.

 

Oh my fish all the way ;). I use it on my working mac and home arch system. Love it in both cases.

 

I use zsh for my shell. Primarily because I spent forever customizing it exactly how I wanted it.