What shell are you using?

I’m really curious what shell everyone here uses? Are you usually working with bash, tcsh, zsh, ksh, fish or something more exotic? And why? What are the advantages in preferring another shell to bash?

I’m a pretty boring linux user myself, so I’m using only and exclusively bash. Not the greatest user of it either, just basic commands, navigation and system management. I think that I’d be absolutely lost if I tried to use another shell, but who knows :slight_smile:

I use Fish for two basic reasons:

  1. The basic features of auto completion and color coded syntax
  2. A more logical (to me) way of handling aliases, functions and prompt design
3 Likes

Bash, because it works and I’m to lazy to learn something new right now. :wink:

2 Likes

zsh. Discovered it on Archlinux install ISO and fell in love with it.

3 Likes

Is it the default shell in Arch Linux?

bash 5.0.16. I don’t know why i should use another one?

zsh. But I don’t really use/know any of the zsh specifics other than the nice colour coding prompt. :slight_smile:
image

3 Likes

I am using fish, I love the auto predictions/completions, it makes things a lot quicker and easier to type.

1 Like

The shells have borrowed many features from each other, so for an ordinary user I think there’s not much reason to change. Use the one that is familiar is a good rule of thumb.

I use bash because of compatibility (it is practically always available) and features (it is quite versatile too). And I’ve used it for so many years that I lost count already…

zsh is extremely versatile, but also with a steepish learning curve (to fully use it). The learning curve of zsh has been the reason why I haven’t really studied and learned it. Bash is enough for me, for now at least.

It is easy to understand why people use different shells. Each shell has it high points that others don’t (but may come close…).
Also, the answer depends on what a person is going to do with a shell.

And yes, bash supports command completion too. Simply install package bash-completion if you don’t already have it. And (a recent) EndeavourOS install provides a predefined ~/.bashrc file with some nice tricks!

3 Likes

When I started using UNIX back in 1975, bash, vi, sed , and awk is all that existed.

Those are in almost all, if not all, distributions of Unix, BSD, Linux, etc. They have always accomplished what I needed to do. I have never seen a reason to change. Besides, I am old school in almost everything I do.

Pudge

4 Likes

Only on the install iso.

If I installed bash-completion, would it be similar to fish?

Bash is fine, no doubt. But…it lacks some nice features that you may find in in other shells.
Fish is currently my favorite: the “Tab” is just mighty in fish + “autocompletion” + listing options of commands + highlighting of commands +syntax coloring + themes… make it so nice to use.
Give it a try :wink:

1 Like

I’m using Fish, it has a lot of enhancements built in that you have to fiddle and tinker to get in other shells, such as using the oh-my-zsh add-on for zsh. Fish just has most of that built in, less tinkering required.

All my use in interactive though, those that write shell scripts a lot will probably find fish to be counterproductive for their scripting needs and are probably better served to stay with bash, zsh or even dash for greater compatibility and portability.

Bash-completion allows for completing commands and options by pressing the TAB key.
It relies on having command specific completion files, so not all commands are supported.
You can write your own completion files too, e.g. for your own commands.

Don’t remember how it works in fish, but I guess it is about the same…

Does it also show as a grey highlight or something what command it will autofill when you press tab? Cause that is what fish does?

I’ve just intalled and tried zsh (vanilla, no extensions for now), so far I’ve only customized my prompt.
Bash and zsh prompts together :slight_smile:
2020-02-21-190412_1366x768_scrot

For now I’m mostly playing around with the interactive mode. Querying the commands and keybindings and the default auto-completion seem to be much better done than what bash offers by default.

I’ve configured zsh to use vi(m)-mode, but can’t figure out yet how to make it display different vim modes (NORMAL, INSERT, VISUAL, etc), or at least have some indication as to in which mode I currently am. Is there a way to do it in vanilla zsh?

2 Likes

Not (by default) that I know of. I guess it can be programmed to bash-completion however.
Anyway, by default, fish obviously has more bling bling than bash… :wink:

1 Like

Got my vim-mode indicators in zsh prompt, based on this :hugs:

 setopt PROMPT_SUBST
 
 # start new prompt in normal mode
 zle-line-init() { zle -K vicmd; } 
 zle -N zle-line-init
 
 # vim mode indicator in prompt
 vim_ins_mode="%B%F{46}[INSERT]%f%b"
 vim_cmd_mode="%B%F{45}[NORMAL]%f%b"
 
 zle-keymap-select() { 
     if [[ $KEYMAP = vicmd ]]; then
         vim_mode=${vim_cmd_mode}
     else
         vim_mode=${vim_ins_mode}
     fi
 
     zle reset-prompt
 }
 
 zle-line-finish() {
     vim_mode=${vim_cmd_mode}
 }
 
 zle -N zle-keymap-select && zle-line-finish
 
 RPROMPT='${vim_mode}'

Using if-else in zle-keymap-select() because it’s plainly the closest I can get to c/cpp syntax :expressionless:
And it’s worth noting (well, for me it wasn’t obvious) that setting PROMPT_SUBST and using single quotes in assignment to RPROMPT is important there.

i use bash