Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use oh my zsh for exactly one reason: I can get a good shell experience out of the box and immediately start working on stuff productively, whether it's a new machine, a new remote host or a container.

I could spend hours figuring out all those things, bit I'd rather use that time for something more important.



Try https://starship.rs then. Starship gives you the same "drop in and go" experience but without the 200ms+ prompt lag. One curl -> one line in your rc file, works on zsh/bash/fish/whatever.

Configuration is straightforward and easy imo: https://starship.rs/config/

Give it a spin, I think you won't regret it.


I'm so glad I switched to fish, I'd rather have genuinely good settings out of the box rather than endless configuration, and honestly it's much better out of the box than any configuration I've ever had.

Only drawback is that it's not POSIX, no issue for me, but maybe for people who have a lot of muscle memory with bash.


I tried fish for a while but as someone who heavily used bash before I couldn't get used to the new language. I also didn't feel they the language was much better than bash, at least for my usage. But I loved the default automatic coloring of arguments, underlining of files, etc.

Later I found fizsh, which I love and still use as default shell now. It's basically a configuration around zsh adding the colors, completions, and other good stuff inspired by fish to zsh. Can really recommend it for those who are used to zsh or bash but want their CLI to be more readable. Colors especially help with big command line arguments to show where they start and end, and keeping track of complex stuff like loops and conditional logic in your commands.


fizsh sounds really cool, but the last commit was 7+ years ago. do you run into any issues? https://github.com/zsh-users/fizsh


I never noticed any issues, actually. I guess the zsh base is solid and stable.


Fish is just excellent out of the box. It's a little tragic how path dependent we are on flawed terminal experiences designed 40 years ago.


For POSIX: I leave Bash as the system shell and then shim into Fish only for interactive terminals. This works surprisingly well, and any POSIX env initialisation will be inherited. I very rarely need to do something complicated enough in the REPL of the terminal and can start a subshell if needed.

Fish is nicer to script in by far, and you can keep those isolated with shebang lines and still run Bash scripts (with a proper shebang line). The only thing that’s tricky is `source` and equivalents, but I don’t think I’ve ever needed this in my main shell and not a throw-away sub shell.


I often write multi-line commands in my zsh shell, like while-loops. The nice thing is that I can readily put them in a script if needed.

I guess that somewhat breaks with fish: either you use bash -c '...' from the start, or you adopt the fish syntax, which means you need to convert again when you switch to a (bash) script.


I guess my workflow for this is more fragmented. Either I’m prototyping a script (and edit and test it directly) or just need throwaway loop (in which case fish is nicer).

I also don’t trust myself to not screw up anything more complex than running a command on Bash, without the guard rails of something like shellcheck!


I used to do it this way, but then having the mentally switch from the one to the other became too much of a hassle. Since I realized I only had basic needs, zsh with incremental history search and the like was good enough.

I don't care for mile-long prompts displaying everything under the sun, so zsh is plenty fast.


After 10 years on zsh I finally switched 6 months ago and I haven't looked back. If I need POSIX, I'll just run scripts with the right shebang or pipe it to sh.


I've been using fish for nearly 10 years.

First, there are some ways to make fish more compatible with bash.

If you want to do some shell scripting in fish, or running other people's shell scripts (or commands) this may aid you since you wouldn't have to port them (or take less time to port them over).

You can achieve this with a plugin system such as 'oh my fish' or 'fisher'. But, as always, it adds complexity (and bloat :P), you'll need it on every fish shell (including remote systems), etc.

It is a bit akin to having nvim with plugins versus being able to use vi. Sometimes, you're going to need to be able to use the latter.

Also, to people who recently adopted fish: fish has been made more and more compatible with bash throughout those years.

FWIW, I use fish with starship these days.


When I'm in fish and I want to run a bash script I just... call it with bash :-)


./script.sh

and script.sh just starts with #/bin/bash

I'm simple


If I use fish, I want to make use of it, and that means I will want to convert scripts, or simply learn to write scripts compatible with fish.

Shell scripts from third parties stick with whatever shell they were written for (ie. /bin/sh or /usr/bin/env bash), and commands copy/pasted from the internet are either quickly executed with bash (one-off) or ported over. Because I like to have such in my history (fish is configured to use atuin), I want to keep using the same shell, so I try to stick with fish. If I cannot convert a command (usually a bunch of commands) to fish, it is PEBCAK and a learning curve/experience.

As for tmux, that is solid advice, because it also allows to stick with a shell which is known to work. I've come to like zellij with alacritty, with zellij the option is default_shell. But now that I use ghostty, I don't use a terminal multiplexer locally any more; only remotely. And there I still use tmux.


This wouldn't work if the script is meant to be sourced (to set environment variables) isn't it?


No, it doesn't.

The way I actually have things setup, in case it helps. I don't change my default shell. I actually default to pretty much working within tmux. So, I kept my default shell to what the OS brings, then in my tmux config, I have,

    # set shell
    set -g default-shell /opt/homebrew/bin/fish
This means, that when I start my terminal, it drops me to zsh (macOS default). Then when I run tmux, it opens fish. The nice thing is that I inherit the environment of zsh.

I have my .zshrc and my .bashrc sourcing a .shellrc file which contains most of my env stuff. This keeps random utilities that write to .bashrc and zshrc working within fish too.


It’s only takes a second to run a child bash shell when you need something posix


I have been using fish for 10 years now as my main shell and it is just perfect.


I'm surprised Starship is so popular. It's missing really basic powerlevel10k features like empty segments. If you look at some examples:

https://starship.rs/presets/gruvbox-rainbow

You can see that when the segments are empty, they still appear as a 1-width segment, rather than entirely disappearing.

It also makes you configure many things by hand. powerlevel10k has an interactive wizard that lets you design your prompt one option at a time (do you want a nerd font? do you want it one line or two? etc) but Starship makes you manually write escape codes if your preferences don't match one of the presets.

No judgment, but I do wonder what people like about Starship that makes up for these things.


Starship allows empty segments, I in this specific case it's just how the preset/theme works as it uses the Unicode character as separator and it needs to set the background and foreground colors depending on which modules is surrounded by


Every preset with powerlevel10k-style segments don't support hiding empty segments. Look at Pastel Powerline, Tokyo Night, Gruvbox Rainbow, Catppucin Powerline...

https://starship.rs/presets/#pastel-powerline

I tried making my own and the config TOML syntax isn't expressive enough to support hiding empty segments.

You're right that it's the thing with the Unicode character as separator, which all the alternatives handle just fine: powerlevel10k, tide, oh-my-posh... it's just everyone seems to love Starship, and that's what confuses me.


Also oh-my-posh supports transient prompt and AFAIK starship.rs does not.

"Transient prompt, when enabled, replaces the prompt with a simpler one to allow more screen real estate." https://ohmyposh.dev/docs/configuration/transient

Here is my config for oh-my-posh https://github.com/rofrol/dotfiles/blob/master/.config/oh-my...


Just tried Starship, even though it wasn't the first time I'd heard about it. I would not say it is a 'drop-in and go' experience. Let me explain.

After installing and adding it to my bashrc, I was wondering was those version numbers and cloud symbols meant. Turns out: Since NodeJS and Python were installed, it found a good idea to print the respective versions. I could not care less about those versions. The other part was that it thought that I would like to see my AWS region. Well, I mean, I have built something with AWS a few years back, and the config file for that still exists, but no, I don't want to see that region every time I open a shell. Finally, the default is to have the prompt in a new line. I think when you have a long prompt that makes sense, and it might also be a taste thing. However, the documentation has this example at the beginning about newlines:

  # Inserts a blank line between shell prompts
  add_newline = true
So I thought `add_newline = false` should do the trick, but it didn't.

Luckily, the AI (GPT-5.2) was pretty good at explaining and giving instructions for changing things. So after 30 minutes, everything was understood and configured to my liking. I like the result, but the default was pretty weird.


I tried using Starship, and it’s clearly faster than Oh My Zsh, but my issue was that I relied on some useful Oh My Zsh features that I didn’t know how to replicate in Starship. One of these is history filtering - for example, when I type source and press the up arrow, I only see previously run source commands, which makes it easy to find what I’m looking for. I tried to get this working in Starship, but had no luck.


I haven't checked out starship yet, but if I understand what you are using, that is Zle functionality. It's part of OMZs configuration (here: https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/key-bindi...) but doesn't use other OMZ features.

I don't know if starship is still using Zle. If so, this should be possible to configure without OMZ.


Oh thank you, I was looking for this. Will try it.


Control r. This is a zsh feature not a starship/oh my zsh feature


I think that's just a standard readline functionality. It's available on bash, out of the box.


Absolutely and in zsh too, out of the box. It kind of blows my mind that people think they need all this additional bloatware for things which have always just worked (at least as far back as like 96 or so which is when I started using Linux) but it wasn’t new then.

Wait till people learn they can use rlwrap to get the benefit of readline even in things like commandline sql clients, which often lack this.


I think convenience inherently comes with bloat. This is true for many things in life. Most people use cars simply to drive to work and back, yet they don’t use 90% of the features sold to them by salespeople.


Oh my god! How did I not know about this! Thank you! Are there any other useful tips like this one?


You are most welcome. Probably hundreds but I don't know what you don't know. It's worth learning some old-school command-line history fu as well because that is often useful. I've written up some things I have found helpful here[1]

One thing which is not in the writeup but should be (and I mention it in a sibling thread) is "rlwrap" which is a readline wrapper which imbues whatever program with readline editing and history niceness.

So say you have to use some crufty cli like a sql cli or something that doesn't have commandline editing or history. You run "rlwrap horrible_sql_cli" aaand now it does. Really helpful.

[1] https://www.uncarved.com/articles/unix/


Ob Linux it's actually handled by inputrc


mirzap was probably using some omz plugin to do that, so if starship fully replaced omz, that functionality went away, too.


I have never used Oh My Zsh, but I use Atuin to do this and it works excellently at that. You can even make it filter by what folder you're in and whether you want to search only this session or host (you can sync shell history across hosts). It never occurred to me that this is something I'd want from a shell prompt, which is what Starship is.


check atuin for history search


From what I can tell, this doesn't nearly fill the gap that OMZ occupies

Nice history, command auto complete, and similar beyond just the looks, out of the box


Also oh-my-posh supports transient prompt and AFAIK starship.rs does not.

"Transient prompt, when enabled, replaces the prompt with a simpler one to allow more screen real estate." https://ohmyposh.dev/docs/configuration/transient

Here is my config for oh-my-posh https://github.com/rofrol/dotfiles/blob/master/.config/oh-my...


Oh my zsh makes installing extension so easy, just edit .zshrc and add extract, fzf, z, etc. To the list of plugins


What? You still have to install the binary via your package manager. Most OMZ plugins are basically a bunch of shell completions or aliases.


Some are built in

starship is great. I use it with a powerlevel10k fallback in my dotfiles for systems, starship is not installed yet to not break the shell entirely.


Starship is a single binary, pretty easy to carry around even the first time you ssh somewhere.


I'm totally aware... However p10k is the thing I used before so fallback was a low hanging fruit.


I'll second this. I've had a really pleasant experience using Starship across development environments.


Never heard of this, looks pretty good. Are there any community themes based on starship like powerlevel9k/10k?


It requires a nerd font.


FWIW if you're on a machine where you're allowed to use non-default configs like oh-my-zsh, you could also just copy over your own custom config. It seems like you're implying the alternative to using oh-my-zsh is to rewrite your config from scratch every time or use the default. It doesn't quite add up to me. If you craft a config file of your liking one time, then back it up somewhere, track it with git, whatever, you can keep making use of that config across other machines. I just set up a new personal machine recently, grabbed my dotfiles, now it's the same familiar feeling as my other machine.


> just copy over your own custom config

That already defeats the purpose:

I don't want to copy things around

I never spend time crafting a custom config


Crafting a custom config is right up on the list of things I enjoy. Right up there with creating new characters in video games that allow lots of customization.


I just use fish shell. Way easier.

https://fishshell.com/


I recreated my several hundred line + several plugins zsh config in a few dozen lines of fish and one plugin (fzf.fish), about 8 years ago. It’s been a joy to use.


Biggest problem being not being able to paste much of the complicated code found online. You can save it and run it via bash command though.

oh my zsh can recreate much of the fish functionality while maintaining good bash interoperability.


This is the most common complaint I see for switching interactive shells to fish/nushell, but it's not a problem in practice. You don't ever uninstall bash, so if you've got a command to paste:

  bash <enter>

  <paste> <enter>

  exit <enter>
Tada!


Exactly this, couldn't be easier. Heck, I run into this all the time on macOS whenever an LLM gives me a Bash one-liner that for some reason doesn't work with ZSH. It's easier to just pop into Bash than analyze and adapt that command line to ZSH.


> couldn't be easier

Except for the single step workflow: <paste> <enter> like you do on POSIX shells?


Couldn’t be easier to use another shell. As in: it’s hard to imagine making it even less complex. Which means it’s no burden at all.

Do you get it now?


Yeah but you can use something like zim that is better than omz but still easy. The shell starts so fast with zim and it is a breeze to set up


Exactly. The popular culture has bad picks. We can be low effort without necessarily being 100% unselective! No taste is not mandatory! Just the littlest bit of trying & listening to our peers can make a better world.

There's so many better non-shite alternatives. Just one: Zim aka zimfw is one. It's just so sad that there's such a negative creep energy towards "I tried nothing and did nothing and this is where I am". Bad hacker bad. You deserve no voice.


People should be encouraged to play and explore. I landed on Zim eventually, but it's far from universally installed on my machines.


Hmm, weren't dotfiles invented just for that reason?

I'm joking but on a more serious note, installing a shell as a default shell seems more complicated than copying over your .bashrc


    more complicated than copying over your .bashrc
In case you weren't aware, MacOS uses zsh as the default installed shell. The bash version that comes with MacOS is some ancient 3.x version, from 2005.


I think you where trying to say something and then stopped just short of actually making your point. Please continue.


Just that it would be `.zshrc` since zsh is already the default shell in the context of this post unless you enjoy a mid-2000s existence and none of the nice bash features of this generation (in which whatever `.bashrc` you've crafted is likely broken by time passing).

Maybe I'm underinformed, but I don't personally know any Linux users who convert to zsh, instead opting for fish or something else (oilsh? nushell?).


zsh has similar files that can be copied over to other systems.


I stopped using Oh My Zsh for exactly one reason too: It was so freaking slow it had a noticeable effect on my shell and my mood. It frustrated me that I had to stop and wait every time I opened a tab.

So I removed it, then continued using Zsh and whenever I missed something from before I looked up what it was and installed the plugin easily with Homebrew. The whole process took under an hour. I realised I only needed two or three plugins.

Now my shell is fast, without unnecessary bloat, and does what I need. I’m much more productive and happier, and at the end of the day I don’t really see what’s more important than that (within the scope of the conversation).


> I could spend hours figuring out all those things,

This post is explaining how to set up those things. Less than five minutes to read.


Less than five minutes to read but how long to set up my own? The author only showed what he needs/prefers ("Here is my config for starship"). I'll need to navigate the documentation of starship to figure out all those options, which defeats the purpose. Their config documentation (https://starship.rs/config/) already gives me headaches.

And from the article

> Because cloud services are available globally, I've disabled them.

That's some bad defaults right there.

> When you run a command, it also shows how long it took to execute.

No I absolutely don't want this thing done by the author. Now I am fully in the "customize my config" territory.

Also, most of us are unlike the author, and 0.07s vs 0.38s startup time means no difference.

I think the point of the previous comment has been more than clear enough.


> Also, most of us are unlike the author, and 0.07s vs 0.38s startup time means no difference.

That's quite likely a workflow thing. If you are popping up new (transient) terminals frequently, then a ~400ms wait time for each adds up and makes the entire machine feel really slow. I'm willing to wait extra half a second for a new terminal -- once -- after I've changed my autocompletion configs (rebuild + rehash takes a while), but if I had to wait for that long every time I hit Win+enter and wait for the terminal to become active, I'd be irritated pretty damn quickly too.

You get conditioned to immediate responses pretty fast.


> Less than five minutes to read.

OMZ is still easier to set up consistently. That’s why we use it.

If the concern is the bloat of OMZ then make FMZ - fast my zsh - that is just as quick to set up and doesn’t add “bloat”?


I won't spoil the article, but if you read to the end you'll find out what this "FMZ" project is called.


Can you spoil it for me, because I read it to the end and saw no mention of such a project. Unless you are referring to the DIY approach the article suggests.


Somewhere else in the comment thread Zim (zimfw) was mentioned which after reading their website sounds pretty much like that.


That misses the point. I don’t even want to think about any of that stuff.

It’s a single command to install oh-my-zsh. I can fire it off, check Slack, and come back in 5 minutes. If I have to take 5 minutes to setup it up, I’m just not going to do it.


Caring enough to read a blog post and comment on hackernews, but not enough to copy/paste the changes from the blog post is a very fine line.


This is common low-quality internet arguing ("you care enough to come into this thread but..."). You can avoid this by keeping in mind that different things are different things, and analogies have many holes by default.


Not sure what your point argument is.


Their point is that what you complain about as "time consuming" is not time consuming at all and that you consumed more time reading the post and commenting on HN that actually installing starship.

In your defense I must say I installed starship ages ago but still not migrated to it from powerline-go because I'm lazy.


[flagged]


It's a tool.

Some chefs like to spend hours sharpening their knifes with wet stones. Others are just going to run it through a power sharpener and get on their way.

I like to focus my craft in places other than the terminal.


Different strokes I guess. Personally I think any time spent tinkering with the shell is a waste of time: a basic, zero-customization bash is just as good at doing things for me as a shell that I've messed around with the settings on for ages. So I don't waste time on customizing my shell because it provides no value to me, while those who get value can spend the time. We both win.


there's some nuance to this. people might want to spend minimal time hacking on their shell and more time hacking on things they find interesting that are not related to shell setup (and also not webshit). besides even if its webshit, what makes you say shell setup hacking is more or less interesting compared to webshit hacking. the term webshit itself implies you view it as less interesting than shell setup -- fair if thats your pov, but doesnt make it intrinsic.


> important webshit to build

hackernews: where a large portion of programmers are considered inferior because of the domain they work in (the domain where hackernews also lives)


It’s more that tired experience has taught that of the various disciplines, web devs are the most likely to have a shaky-at-best understanding of fundamentals, and thus do silly things like assume network calls will never fail, or store everything in JSON blobs and then wonder why their queries are slow.

I’ve also worked with some awesome web devs, to be fair.


Time is finite.

I could spend that time tinkering with the internals of an ad-hoc informal system cobbled together in the 1970s and held together by spit and glue.

Or I could just not do that.

Also, the implication that fiddling with shell scripts is somehow a better engineering/programming practice than web programming is laughable at best.


Hacker News: Where the hackers don't want to think about the code required to build the webshit nor the command-line nonsense used to write it, because the agents will take care of all that.


I've spent few days and got some basic zsh settings adjust for me. Since then I'm mostly using zsh with very little configuration and I like it a lot. Yes, it's a steep curve, but I'm spending all my life in zsh, so I think that was good time investment for me. In my experience default zsh settings are good enough and require very little customization.


You really only have to go through that once and it's a good learning experience.


I will have forgotten almost everything by the time something inevitably breaks in a few years. Unless I am constantly recalling the knowledge and applying it, I don't find it worth it. And I _don't_ want to be constantly recalling this knowledge. I want it to just work.

OMZ has been working steadily for me for the past 8+ years. Autocomplete, syntax highlighting, and a concise prompt--really all I need.


I mean you learn things about the shell ans shell scripting in general which you do retain. Also shell config is one of those rare things that doesn't "inevitably break." The only stuff that breaks are related to program settings which omzsh isn't going to handle anyway. You end up learning a bit and have a much lighter config. Case-in-point, you had to spend some time combing through and learning all the aliases it defines you when you could maintain a small few that you actually want. Also, zsh has plugins natively.


just install fish then


One man’s bloat is another man’s feature.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: