soraminazuki 11 hours ago

With articles like these popping up all the time, oh-my-zsh is seriously harming zsh's reputation. It's giving the wrong impression of zsh being slow and bloated.

zsh doesn't need configuration frameworks or plugins. All it needs is a change in the default settings so that its powerful completion works out the box. It currently needs more than ideal amount of tweaks to the defaults, which is probably why people flock to these frameworks.

  • kmarc an hour ago

    FWIW I only ever saw zsh at colleagues screen(share) with Oh-My-Zsh

    1. Utterly slow and cluttered

    2. Colleagues leverage a tenth of its power than what they could achieve with pure bare bones bash

    Therefore, never bothered to even try (but had to fix some one liners so that they work on their fancy setup). Also, was surprised that macos switched to it as its default.

    I guess I never jumped on the oh-my-it's-so-slow-zsh bandwagon. OTOH, fish+starship combo /that was also recommended here/ seems interesting

    • fmbb an hour ago

      Starship can also be really really slow with the defaults, although that is not starship itself beings slow but it appears to sometimes call out to slow tools when display toolchain info.

      I always turn all of the languages plugins off in Starship for this reason.

      • kmarc 39 minutes ago

        Honestly, I'm quite OK with bash+liquidprompt. It is probably an order of magnitude slower than these fancy new stuff.

        Even with a huge monorepo and git stats displayed after every press of return it's OK (I win time at other places), but it's intriguing to have the same fast prompt display that I would otherwise have outside local git clone's directories.

        What seems sexy about fish/starship is that there is built-in performance check / benchmark for slowdowns.

  • hdjrudni 11 hours ago

    I don't want to spend ages figuring out which knobs to turn to get a half decent shell. If there's an alternative to oh-my-zsh that looks halfway decent, has that nice fzf integrated, and the 'ghost text' history suggestions, then I welcome it!

    • soraminazuki 10 hours ago

      If zsh has its completion fully configured by default, there will be no need for most people to turn knobs nor will it be a "half decent shell." It'll be the best shell, if it isn't already.

      I wonder why ghost text history suggestions are popular though, I'd rather not have it. Shell history search works better, and I don't want my shell always showing me or whoever else is looking at the screen random commands that I've previously typed.

      • opk 4 hours ago

        > If zsh has its completion fully configured by default, there will be no need for most people to turn knobs nor will it be a "half decent shell." It'll be the best shell, if it isn't already.

        The curse of backward compatibility means that zsh does not break your setup or change things on you. And there are still developers left who bear the trauma from the one time that was tried back in the early-mid 90s in the 2.x version series. Sadly that means many new features remain inactive by default, especially anything written in shell-code like command-specific completions.

    • kstrauser 7 hours ago

      IMO, that alternative is Fish shell.

    • alabhyajindal 11 hours ago

      You should try fish shell. Great user experience out of the box, including history suggestions.

      https://fishshell.com

      • cbarrick 10 hours ago

        The incompatible syntax of fish makes it a no go for me.

        As an SRE, at my day job I often need to copy/paste commands that are generated from a playbook.

        Our playbooks use Bash, and in practice Zsh is compatible. But a co-worker using fish often has to manually modify commands before running, and I'm not about that life.

        The problem with fish is mostly the different syntax for setting variables and lack of heredocs. Sometimes the string substitution differences come up too.

        • porker 30 minutes ago

          We have everything as scripts rather than one-liners so they work fine no matter which shell you're using.

        • anon7000 7 hours ago

          Exactly. Variable assignment works different in Fish, and it’s very hard to change that habit. With my usage of shell (with Fzf & zoxide), fish simply doesn’t improve much for me. I’m using bash constantly for my job, and having the same syntax in my shell is important

    • bbkane 5 hours ago

      I'm definitely not an expert, but I configure zsh manually with those fzf and "ghost text". I took some notes in my repo, just copy the relevant portions if you actually want to try this: https://github.com/bbkane/dotfiles/tree/master/zsh

      I tweak it occasionally, but for the most part I set it and forget it.

    • doubled112 10 hours ago

      Once you have everything figured out, you just keep using the config you have. It might be worth the investment. I stopped using oh-my-zsh when I realized it was what was causing multi-second delays on Raspberry Pis.

      I think auto suggestions and syntax highlighting plugins can be installed separately from oh-my-zsh.

      I use starship for a better prompt, and it works on more shells than just Zsh.

      I also have Atuin installed to share history across machines, and as a benefit the history search is a lot more powerful.

      https://github.com/zsh-users/zsh-autosuggestions

      https://github.com/zsh-users/zsh-syntax-highlighting

      https://starship.rs

      https://atuin.sh

    • wpm 7 hours ago

      Zim has been my choice since I got sick of multi second startups with OMZ.

    • loeg 9 hours ago

      I don't know if it's still in vogue, but prezto exists.

    • grrowl 6 hours ago

      Look into zgen, it's a zsh plugin system but much more static (but less ridiculous out of the box)

  • mcdow 5 hours ago

    Came here to say this. I was able to get an omz featureset from vanilla zsh with a handful of lines of config. It works for the features I was using from omz.

  • varispeed 10 hours ago

    Out of curiosity, what is wrong with oh-my-zsh?

    I use it and never had any issue. Am I missing out on something?

    • soraminazuki 10 hours ago

      If it works for you, that's great. But people are installing oh-my-zsh almost as if it's an official requirement of zsh, run into bloat and performance issues, and goes off telling everybody not to use zsh.

      Some of the autocompletion settings set by oh-my-zsh are useful. But apart from that, the majority of the code consists of gazillions of random aliases and functions that someone else needed. It pollutes the command namespace for no good reason except maybe making users more wary of typos. The last time I checked, sudo was aliased as "please", and I can't find a single reason why that'd be useful.

      oh-my-zsh also introduces a lot of churn, which is why it has autoupdates. Autoupdates. The only time I needed to change my configuration in vanilla zsh because of a change in zsh was once or maybe twice over a span of 10+ years.

      • mattgreenrocks 8 hours ago

        OMZ shouldn’t be imposing these issues, and autoupdates of a shell script manager is aesthetically disgusting. But there’s also an argument to be made for not cargo culling configuration.

f311a 11 hours ago

Did something similar recently as well. I did not notice any need for plugins from day one of switching. Fzf can replace a lot of plugins if you know how to use it.

Things like git branch name and virtual envs are handled by starship.

My custom config is less than 10 lines now:

  export HISTSIZE=1000000000
  export SAVEHIST=$HISTSIZE
  setopt EXTENDED_HISTORY
  setopt autocd
  autoload -U compinit; compinit
  source <(fzf --zsh)
  eval "$(starship init zsh)"
  set -o vi
srvmshr 14 hours ago

I discovered this issue 2-3 years ago. On slightly older machines, there was a palpable startup time. My fix was going through OhMyZSH and stripping away all the parts that I felt unnecessary (I call this my "leanZSH" and its considerably lighter version of OMZ.) It doesn't track upstream, and I manually update the plugin directory once in a while. Surprisingly OhmyZSH is pretty modular and doesn't break easily.

[Not the best hackjob out there but here it is:

https://github.com/gradientwolf/leanzsh

If you want to update it just copy over the latest `plugin/` folder from OMZ repo. You can get rid of all the plugins you dont want, as well as the themes. It somehow works]

  • SamDc73 13 hours ago

    I think you're better off switching to https://starship.rs

    I did try to do my whole zsh config/theme from scratch, but it did take some time and lot of small features here and there were no worth the effort (like python version, vevn, and such) so I just switched to starship which is very fast and easy to use

    • lompad 12 hours ago

      Why not just use fish at that point? It's been rewritten in Rust too.

      To me personally, oh-my-zsh and similar projects feel like a worse version of the stuff fish brings by default.

      • Jubijub 11 hours ago

        Fish is awesome, but there are times you need POSIX/ bash-like shell syntax

        • ewuhic 11 hours ago

          Then you open bash and get POSIX and not bash-like, but bash.

          • krab an hour ago

            In fact, sometimes I open bash even from zsh. When pasting from a script and debugging why something doesn't work as expected, I don't want bash-like. For ad-hoc loops, bash-like works well for me thanks to the familiarity of syntax.

WhyNotHugo 14 hours ago

Oh-my-zsh has a lot of cool and handy features, but it is a huge and complex beast. Personally, I only cared about 3–4 features, so I simply removed it and sought out how to enable those features alone.

Additionally, a lot of functionality which I wanted wasn’t there in OMZ, so my setup had a lot of custom bits anyway.

My zshrc, for reference: https://git.sr.ht/~whynothugo/dotfiles/tree/269248912920d25e...

  • mroche 2 hours ago

    I am absolutely stealing this:

        export LESS='-RX --quit-if-one-screen'
    • JimDabell 15 minutes ago

      This is my config:

      https://pastebin.com/ATZeFJRk

      I find that for persistent configuration like this, it helps to use the long option format and include the man page contents for those options. I don’t have these options memorised so it’s good to have a reference handy to remind me.

  • bravesoul2 13 hours ago

    What's with the emoji alias?

jauntywundrkind 8 hours ago

There's so many plugin systems for zsh. From comments it seems like Pretzo is the main one suggested.

But there's a huge list of different offerings. Looking at https://github.com/sindresorhus/pure?tab=readme-ov-file#inte... , there's also for example zim, zplug, zinit, zi. It's be so great to have see some deeper investigations or comparisons: is Pretzo really the best choice? Aside from seeming popularity, why?

At least found this neat gist with a cheat sheet for different zsh plugin systems (and how very many there are!) https://gist.github.com/olets/06009589d7887617e061481e22cf5a...

Sparkenstein 12 hours ago

I moved to fish 3 years ago, haven't noticed a difference till date.

  • cevn 11 hours ago

    Fish school represent

  • notnmeyer 12 hours ago

    you are wise and have good taste

OptionOfT 7 hours ago

I use Starship, so this applies to both ZSH & Fish:

If you have the Python environment displayed in Starship, your largest gain in speed is to replace pyenv and pyenv-virtualenv by uv.

opk 13 hours ago

I'd be rather skeptical about the "fix" of updating the completion cache once a day only. Enabling oh-my-zsh already runs `compinit` and it does so after changing the function path in `fpath`. By running it again with a different `fpath` you invalidate the previous cache - meaning it builds a fresh cache twice every time you start zsh. If you use a plugin framework that already runs compinit, simply don't run it again separately. And make sure that `compinit` is only run after the final plugin or whatever has finished changing `fpath`. If you get that right, you'll only ever need to regenerate the cache when something actually updates.

Jerry2 9 hours ago

I switched to Prezto [0] because I found OMZ too slow. Prezto is much faster out of the box and doesn’t have a lot of things enabled by default. Definitely give it a try if you find OMZ too slow on your machine.

[0] https://github.com/sorin-ionescu/prezto

mcc1ane 14 hours ago
  • satvikpendem 14 hours ago

    Sadly it's essentially discontinued

    • nadir_ishiguro 8 hours ago

      No. The author simply sees it as basically complete and decided to spend the time he has fixing bugs instead of taking care of issues.

      • satvikpendem 8 hours ago

        > MOST BUGS WILL GO UNFIXED

        • opk 4 hours ago

          It's just a shell prompt. There really won't be much in the way of bugs. And it's popular. Doing a quick scan of github issues, there's no shortage of questions where some other random plugin or weird terminal emulator has strange interactions. I think the author can be forgiven for not wanting to diagnose such combinations.

          • dolmen 3 hours ago

            As a former maintainer of LiquidPrompt I can only agree.

    • trallnag 13 hours ago

      I'll continue using it until the core features like instant prompt and transient prompt start to break or I run into bugs that I can't live with

  • jimbru 11 hours ago

    this is the answer

eviks 3 hours ago

> Making Spaceship Prompt Faster (22.47% → ~5%)

Or even better switch to starship, a compiled binary doing the prompt formatting?

stouset 13 hours ago

Fish shell with starship. You will never look back.

  • f311a 11 hours ago

    Fish is nice, but syntax difference is a no-go for me. I frequently log into different servers that usually use bash.

    I miss simple things like alias when I temporary want to assign long commands to a shorter alias.

    • stouset 8 hours ago

      I still script in bash and I still know bash. It’s just not that big an ordeal to code-switch between the two.

      • anon7000 3 minutes ago

        It turns out that it’s pretty annoying to have completely different fundamental syntax for something like variable assignment when so many things are the same. If I’m living in bash scripts half the time anyways, it’s just fundamentally annoying to accidentally type “foo=123” into fish and to get an error.

        If I could use fish without set, maybe I would

  • rtkaratekid 12 hours ago

    I started using fish on a dare from a coworker who thought it would be funny. Joke’s on them, it’s been five years and I still love it. Started using starship this year and agree with you.

  • marliechiller 13 hours ago

    Funnily enough, the startup delay of oh-my-zsh is exactly what prompted me to try out fish and eventually starship on top. I have not looked back as you say!

  • leosanchez 11 hours ago

    My fish config is maybe 5-10 lines just starship, zoxide, direnv.

  • raekk 13 hours ago

    [dead]

massysett 9 hours ago

The instant I saw the title I knew the post would be “I turned off oh-my-zsh” or “I tweaked oh-my-zsh.”

Yes zsh has a bunch of settings and dense documentation, and it can be hard to understand. The problem with something like oh-my-zsh is that now you have two things you don’t understand, and worse, when something doesn’t work you don’t know which one isn’t working or where to look.

jpmonette 10 hours ago

Fish is the way to go! Used to be a fan of ZSH but also struggled with performance issues. No performance issue with Fish! Only issue might be plugins / some copy/paste bash stuff, but it's so worth the performance.

samgranieri 11 hours ago

Ooh, bookmarked! My 11 year old zsh setup, which started from YADR and has stuff from other places preserved in chezmoi is starting to drag. Time to speed this up or just rip up and redo

jasonjmcghee 13 hours ago

Thanks - that pushed me to profile, and as others mentioned nvm was the biggest culprit, then powerline status, which i swapped to powerline-go. nice and snappy startup time now.

  • forsalebypwner an hour ago

    same here, nvm was absolutely wrecking my startup time and I almost never use npm/nodejs.

rezmason 14 hours ago

Aha! Now I know that nvm was slowing my shell startup down. Now I've reconfigured .zshrc to lazy-load nvm, and everything's snappy:

  zstyle ':omz:plugins:nvm' lazy yes
st3fan 4 hours ago

easier to switch to fish

RGBCube 13 hours ago

From the post, it seems like ZSH tries to update on every shell spawn:

   DISABLE_AUTO_UPDATE="true"
WTF? Even if we ignore the crime of non-critical software updating itself, the fact that it does it on every start instead of every day or week is insane.

I do not want my shell sending network requests to odd servers without explicit action from me, thanks.

  • slacktivism123 13 hours ago

    >it seems like ZSH tries to update on every shell spawn

    Learn your tools first, not bloated frameworks. There's a gulf of difference between vanilla zsh and this:

    >Community-driven (with 2,400+ contributors) framework for managing your zsh configuration

    >Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc)

    >140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community

    • RGBCube 12 hours ago

      Sorry, I meant oh-my-zsh. I know that the core shell doesn't update.

      I still think it's bad. You shouldn't rely on a million different package managers, just 1 is enough. (2 if you are feeling spicy: Flatpak)

      • Arrowmaster 11 hours ago

        That's what ZSH has turned into. Every new user installs OMZ because that's what the Internet tells them to do. Then their shell config turns into a huge mess.

        So half the users are using OMZ with a bloated slow config and the other half are reinventing new config managers every year because of how terrible OMZ has become. And constantly churning through them as they keep getting abandoned.

        I've been happily using zsh4humans for years but will need to find a replacement at some point as it's now going unmaintained too.

bananapub 10 hours ago

fwiw you can just use zsh4humans (as long as you promise not to bother the author) and have all the things in omz that matter and approximately zero startup time

gjvc 12 hours ago

make sure you haven't got too many plugins enabled (start with zero and work up / enable them as needed)

raffraffraff 13 hours ago

As a long time Linux + bash user I switched to zsh three months ago when I was forced to use a Mac at a new job. In every previous job I was able to insist on Linux, but this one is very corporate. I decided not to fight it, except to install AltTab, Karabiner, Rectangle and a script that detects which screen my mouse is on so I can alt-tab through ALL the stuff on that screen (sane XFCE / KDE behaviour).

I can't get used to the atrocious keyboard shortcuts but I have gotten used to the "non-UK UK keyboard layout".

And zsh. I honestly don't know why I didn't just brew install bash right from the start. Without even realising I was doing it, I fought with this bloated bastard for 2 months before finally asking what the fuck I was doing.

I sped up my shell by switching back to bash.

  • homebrewer 11 hours ago

    Pure zsh is alright, it's pretty much just bash with fantastic autocomplete that usually provides short form documentation right there along with the options. So no need to remember (or look up) what -X -d -f stands for. Get rid of oh-my-zsh and give the proper shell another chance.

    • saagarjha 6 hours ago

      I actually like bash's autocomplete better (maybe there's a way to configure how zsh does it, I haven't looked into it).

      • opk 4 hours ago

        If you've only compared against zsh's out-of-the-box completion then you're comparing against the fully backward compatible with how things were in 1993 state. Turn on compinit, and a half-dozen styles to enable descriptions at the very least. The content of `StartupFiles/zshrc` from zsh sources is more than enough, no need for a bloated framework like oh-my-zsh.

  • soraminazuki 12 hours ago

    What on earth are you talking about? zsh isn't bloated by any stretch, nor is it any slower than bash in any meaningful way.

    Chances are, like in the article, you installed oh-my-zsh, a third party configuration framework.

    • cb321 7 hours ago

      Some data in support of @soraminazuki (who makes good points throughout this thread) on an i7-1370P linux laptop running Linux 6.15.7:

          $ tim 'bash -lic logout' 'zsh -lic logout'
          55.3 +- 3.7 μs  (AlreadySubtracted)Overhead
          7454 +- 26 μs   bash -lic logout
          7934 +- 39 μs   zsh -lic logout
      
      (Using https://github.com/c-blake/bu/blob/main/doc/tim.md)

      About 20,000 entries in the Zsh history slowing it a little. All completion activated (but zcompile'd, along with a very large digraphs.zwc).

      I think most would not be troubled by taking 1.06X longer, though, especially at this 8 ms scale and for interactive session initiation. Note this test upper bounds Time To First Prompt { a different "TTFP" from Time To First Plot ;-) }, since it also exits as part of the `-c`.