Should Fish be the new default shell in Ubuntu (or a flavour) over Bash?

After hearing about how great Fish is over the last year or so, I finally decided to give it a shot. After about a month of usage (setting up my config, writing some functions, etc), I have to say, it’s so much more intuitive than Bash… at least for me.

For one (and maybe my biggest thing personally), the auto-completion is leagues ahead. It’s so nice to be able to be able to reliably hit tab and either get a full list of options or an immediate completion. On top of that, the pre-emptive ghost text showing you what you’ll auto-complete to is a great QOL improvement. Here’s an example of what I mean (please keep in mind my bash and fish configs are similar but not identical, so I wouldn’t expect to see the same output exactly).

Bash single tab on known command

bash_tab_complete

Fish single tab on known command

And this is just one chunk of what’s better (for my personal use). I find the scripting to be more intuitive, performance to be better, configuration to be easier, and so on.

Does anyone have any thoughts on this? I’d love to hear input from others!

1 Like

Sorry, that can never happen because most solutions out there would break in the Fish shell.

> home=`echo $HOME`
/home/nteodosio`: command not found
fish:
home=`echo $HOME`
           ^~~~~^

Consider the outrage this would cause when unsuspecting users try POSIX-compliant syntax they find in the web.

But do have fun with it!

9 Likes

My thoughts would be keep the defaults. Fish is a great shell but as we see in the world of Linux people are very tribal about there software choices. For example look at the debates that can turn into outright arguments over text editors or web browsers.

How many posts have been created over the years demanding Ubuntu change their browser to something else other than FF or vim should be install as the default text editor. There might be statistics out there but I would say it’s allot.

I say use what makes you happy, embrace it enjoy let it be your Zen.

4 Likes
#!/bin/bash -i
some_commands

on script setup is a way to tell how to use some shell. But it is also possible to have Powershell .ps1 scripts

#!/snap/bin/powershell
some_commands

In /etc/shells are all valid login shells and some drivers(like Intel) have their own install location like in /opt(ional) so some /etc/alternatives default has to be also setup in their case.

But if there is need for multiple drivers(like with clinfo), they need to have their preload or some icd available, but with settings.d mechanism in place there is mess with overriding default settings on each dir as virus mechanism. See alias lslibs='ldconfig -p'

Practically speaking, if some apps need some setup, they should choose those setup and use, like in shell scripts and maybe even some default shell like in VS code could be choosen be in some environment activation…

1 Like

I do not subscribe to the idea that there is a “default shell”.

My approach is to hold my notes - and commands - in CherryTree notes editor.

Then I can mix notes and commands (a range of syntaxes) in one container. Rather like Jupyter Notebooks.

I can keep in my notes …

  • links to web sites

  • codeboxes containing code to run (bash, fish, python3, … add your own exotic scripts such as haxe).

First we install CherryTree.

https://www.giuspen.net/cherrytree/

Now we can launch a CherryTree instance and start with a node to test.

Insert CodeBox (Shift+Alt+D) in node.

There can be multiple CodeBoxes each with different syntax.

We go to File > Preferences > Preferences > Plain Text and Code.

Here we see that we can associate any syntax to each CodeBox.

So we might embed a Bash script in one CodeBox and Fish script in another Code Box and then a Python3 script in another CodeBox … each embedded in different nodes with associated notes and links.

To run the CodeBox in internal terminal go to CherryTree View > Show/Hide Terminal.

In Preferences > Plain Text and Code you can also force the CodeBox to run in external terminal of choice … Qterminal, Yakuake …

CherryTree is my one stop container.

Sending CherryTree containers to others is far better than YouTube presentations since code can be embedded rather than expecting recipients to peer at difficult to read screenshots.

There are of course security considerations to avoid recipients of CodeBoxes running bad actor scripts but they can be overcome. I use a zerotrust data vault to hold CherryTree containers … as elearning modules.

In short use your own custom mix of CodeBoxes embedded in hierarchical notes for each project. A refinement is that CherryTree documents (*.ctd - not sqlite *.ctb) are XML and can be indexed in Recoll through queries such as … ext:ctd … (show all files with extension *.ctd). But that is another discussion for another day.

1 Like

Never heard of CherryTree, but it seems pretty cool from the little bit I just looked into it.

As for the idea that there isn’t a default shell, I get what you’re saying, and that’s valid to a point. Obviously we know how to use different shells when we want (install them, launch into them, etc), but I guess my main point for my post was that for general users, who may just be getting into linux (and might not want to use the terminal but will probably need to at some point), having Fish as a default instead of Bash would give them some better functionality for trying to get along.

For example, if you look at my initial post I made a point of specifically showing the tab completion. Something like this that provides more information for a user who may not know as much is always a good thing imo.

My approach is aimed at new users (such as my family members) getting into workflows. I just do not like YouTube presentations and I find that CherryTree is a friendly repository of notes and executable nuggets of code.
To give more insight create a “default” CodeBox (as defined in preferences - probably sh) then right click on the CodeBox and scroll right down to the bottom of options to “Change Codebox Properties” (or Shift+Alt+U).
Here you see the choice of syntax available.

You can preface each CodeBox with learning material or link to manuals for each syntax.

Users (General or otherwise) can learn how to set up accounts and set their own shell… I don’t see why the entire system has to be fish for this use case?

1 Like

I’ve actually considered this at some length, and wouldn’t rule out a default change at some point.

I don’t have any immediate plans, but I’d like to move toward more ‘friendly’ default tools on Ubuntu. Lots of users seem to carry large bash/zsh configs over years, mostly to achieve the set of defaults shipped with fish.

Having great tab completion, syntax highlighting and git awareness all seem like great things to me.

On POSIX compatibility, it’d certainly be a change for interactive shells, but scripts generally carry a shebang, so anything using bash would just keep using bash.

I think this is something we could think about in a later release, but we’d need to gather some feedback on it.

8 Likes

Those seem to be primarily interactive characteristics of fish? Is that it? To break compatibility for interactive features?

fish’s performance and usage seem less than stellar against e.g. bash. i.e. fish is slower to load, it requires more memory, the continuous processing is considerable for a shell; and even configuration of fish is more expensive.

Of course fish is currently nowhere near as compatible as bash is. e.g. one can not take (or share) fish scripts (to/with other systems, platforms, containers, etc.) with having to install fish et. al.; I’ll grant you that the same could have been said about python at some point, python is not a shell however.

What else is great about fish?

1 Like

You and I need to talk at some point. :slight_smile:

My presentation in The Hague revolved around moving to more GUI tools for end users and away from having to rely on the command line. In Ubuntu Studio and Edubuntu, we made GUI tools for changing configuration files and other things that would normally involve the command line or knowing which config file to change. The best part: They’re only bash scripts using zenity for the frontend, so super easy to achieve.

I understand the command line needs to be used for certain things, but as we keep targeting developers, we have to think about what those developers are targeting. If they’re targeting other developers, then it’s a viscious cycle that we cannot break out of.

I’m a proponent of targeting the end, non-developer user, and that’s best done with GUI tools.

Anyhow, back to the topic at-hand. Sorry for the diversion.

2 Likes

That was the point I was trying to make in post #6 … but in my example using CherryTree rather than Zenity. Another old trusty UI emulator I use is Actiona to drive user interfaces rather than posting screenshots of terminals in YouTube tutorials. Then again there is Jupyter notebooks.

I mean, @dragonfly41, as you can see my reply wasn’t directed at you but was directed at @jnsgruk. :wink: But yes, I can see the benefit.

I wasn’t grumbling (I hope) … just trying to group together thought threads. In recent days I have learned that CherryTree has even richer uses as a front end GUI. Entire nodes can have different syntaxes attached so a node might be entirely dedicated to bash, another node dedicated to fish (if that is the OP’s interest) and then nodes dedicated to more exotic scripts, such as PHP, Python, R … you name it. It proves its value as a first stage marshalling yard of development. I have no development stake in CherryTree … just giving my pennyworth as I embed it into my workflows. I can launch Yakuake or Qterminal from CherryTree. I see these companion tools as a network to leverage. Other similar ideas are in Obsidian vaults but not as rich a choice.

You’re perfectly fine. :slight_smile:

I’d personally very much in favor of a switch to ZSH as it would be still a very nice upgrade (once few plugins are added, it’s just way more good looking and usable and can basically look like fish), while preserving the POSIX and bash compatibility, making it a very transparent switch (you can hardly notice that it’s used, in terms of syntax or scripts compatibility).

Fish, on the other side, it’s very much non-standard, so I feel it would just breaks many users and it’s not IMHO suitable as default. Users with enough knowledge can always change it.

So, I’d really would like that ubuntu would focus in providing a great default ZSH experience instead.

4 Likes

a lot of admins have scripts, often in old fashion perl scripts, but problem with bash(and other shells) are a lot of bugs and then some scripts in bash could not run the way it is desired so some scripts are run(maybe in cloud) and result could differ version by version or choosed OS because version is different and environment is different. And now the gnu bash development seems out of development effort but sometimes something on gnu repo. Nice try, bash.

On the other side, powershell bugs are more wider depth, but with no so much love for MS Love open source(in proper license) initiative when community does the Well loading screen… and MS does the fix problem thing for their licenses and their required support assurances…

I’m using the fish-shell now since a week as default shell and won’t revert back. So far the user experience is great also have rewritten some bash scripts to fish code, the syntax feels more harmonic. I think it would be a good decision to give fish a chance to could be the default shell.

3 Likes

Fish 4.0.2 released today.
Packages can be found here > Packages in “fish shell - 4.x release series” : fish shell - 4.x release series : “Fish shell maintainers” team

:rocket: