this post was submitted on 24 May 2024
13 points (93.3% liked)

Linux

5191 readers
37 users here now

A community for everything relating to the linux operating system

Also check out !linux_memes@programming.dev

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 1 year ago
MODERATORS
 

So I'm currently using zsh + oh my zsh, and have been using it for some years now. It's good, it has amazing features (via plugins) and overall I'm happy with it. But lately it has become laggy for me (probably because of plugins) and I want to see if there's any other shell with features like ZSH but faster and lighter?

I've tried Fish, and usually install it on my servers, but it's not POSIX compliant so learning what commands actually do what in Fish seems like a hassle.

I've heard of Oilshell, Yash, Nushell but haven't tried any of them.

What is your setup for your interactive shell?

you are viewing a single comment's thread
view the rest of the comments
[–] fourwd@programming.dev 2 points 5 months ago* (last edited 5 months ago) (5 children)

Bash has a very strange sequence of sourcing scripts like .bash_profile and others, and the type of shell (interactive or not) adds fuel to the fire. There is no chance to sort through this bunch of init files in order to correctly and conveniently set up environment variables. In zsh, only 3 files are needed for proper configuration; it couldn’t be easier.

[–] thingsiplay@beehaw.org 2 points 5 months ago (3 children)

There is no chance to sort through this bunch of init files in order to correctly and conveniently set up environment variables.

Just use .bash_profile for environmental variables. This file is loaded up each time you login. I use Bash for quite some time now with this file and there is no need to go through various sourced init files. This is the file you need.

There is also a system wide universal file dedicated to all shell environmental variables: /etc/environment . This file however is not a script and it does not understand variables either; as this is the first that runs. But this is active for all users and all shells.

When I used Zsh it was not better than Bash to setup environmental variables, so not sure why you think one or the other is less complicated.

[–] fourwd@programming.dev 2 points 5 months ago (2 children)

so not sure why you think one or the other is less complicated

Because of this:

And some note by the author of the scheme:

Unfortunately, the operation of bash startup scripts is dependent on patches added by OS distributions

Why should I guess at the tea leaves instead of just using deterministic zsh?

[–] suy@programming.dev 2 points 5 months ago

I have to admit that I never understood the need for bashrc and bash_profile. I hated that with a passion when I started to set up my bash configuration. I never saw the need to have so many files and so much complication to have a consistent shell whenever I logged in the console or spawned a konsole in KDE.

The paths shown on that diagram are 7 for bash, and 4 for zsh, so it's surely an improvement. However, now that I have set it all on a git repository, I don't see it as a big deal. I have a profile that sources bashrc, and then I do it all in bashrc. I've checked /etc/skel and it seems the distro does roughly the same (and I've never switched away from Debian or Debian-based in 20 years). I'm not sure if it's such a big deal. But I'm still curious about trying zsh some day. :)

Thanks for the blog post. I'll check it out.

load more comments (1 replies)
load more comments (1 replies)
load more comments (2 replies)