News for hackers. Stuff that matters.
Re:s/bash/zsh/g by chrisweekly on Wednesday October 20, 2021 @09:42AM (#28930567)
Yeah, zsh is great. IMHO Oh-my-zsh is the place to start, for those curious about its capabilities.
Re:s/bash/zsh/g by oynqr on Wednesday October 20, 2021 @10:33AM (#28931100)
I sure love it when my shell takes seconds to load on startup.
Re:s/bash/zsh/g by vlunkr on Wednesday October 20, 2021 @01:35PM (#28933455)
I hear this argument from zsh purists all the time, I'm pretty sure it's made up. I've used oh-my-zsh for years with several plugins and the startup time is basically imperceptible. Maybe it's slow if you're running on raspberry pi or something.
Re:s/bash/zsh/g by soraminazuki on Wednesday October 20, 2021 @01:55PM (#28933735)
Not a raspberry pi but a Macbook.
Re:s/bash/zsh/g by smoldesu on Wednesday October 20, 2021 @06:40PM (#28937749)
Yeah, I can't quite comprehend what makes the terminal experience on MacOS feel so sluggish. At first I thought I was being spoiled by Alacritty, but even Konsole feels more responsive than iTerm these days.
Re:s/bash/zsh/g by sgarland on Wednesday October 20, 2021 @11:50AM (#28932187)
~/.zshrc:L1:"zmodload zsh/zprof"

~/.zshrc:EOF:"zprof"

Doesn't take long to track down the culprits. nvm is a huge contributor to startup lag, IME. I am not a frontend dev, and rarely have to touch Node, so I comment out anything nvm-related for daily work.

Re:s/bash/zsh/g by rustyminnow on Wednesday October 20, 2021 @01:28PM (#28933381)
Nvm startup times are the worst. I use it to install npm versions, but then manually add those to my $PATH.

There's a --no-use flag that short-circuits all the heavy startup processing, but still gives you access to the command.

Here's a snippet from my zshrc: ``` export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --no-use export PATH="$HOME/.nvm/versions/node/v14.17.6/bin:$PATH" ```

Re:s/bash/zsh/g by chrisweekly on Thursday October 28, 2021 @08:53AM (#29025483)
I agree nvm is suboptimal. I've been doing web-related things for a living since 1998 and I care about tooling. YMMV but I have a strong preference for managing node versions via `n` (installed via tiny util `n-install`).

My Node-related macOS terminal setup:

- iTerm.app

- zsh (via brew)

- n-install -> n -> node (/npm)

- yarn (via npm i -g)

- pnpm ("")

HTH! :)

Re:s/bash/zsh/g by eyelidlessness on Wednesday October 20, 2021 @01:01PM (#28933081)
For folks who use nvm and find it slow, try out Volta[1]. It’s much faster, and IMO a lot nicer to use in general.

1: https://volta.sh/

Re:s/bash/zsh/g by nerdponx on Wednesday October 20, 2021 @07:34PM (#28938266)
Yet another NVM alternative is FNM, which is very fast. I'm surprised there are so many others!
Re:s/bash/zsh/g by krinchan on Wednesday October 20, 2021 @04:25PM (#28935987)
I just use nodenv via anyenv. All the ${X}vm utilities have massive startup lag for some reason.
Re:s/bash/zsh/g by kimbernator on Wednesday October 20, 2021 @10:48AM (#28931306)
It is easy to go overboard with oh my zsh for sure, but startup time, as long as it's less than ~5 seconds, is not likely to be a big problem for most people. On slower machines the real killer is the time it takes for the next prompt to appear after each command. There are mitigations, but I've definitely had machines where it is almost unbearable.
Re:s/bash/zsh/g by nemetroid on Wednesday October 20, 2021 @11:07AM (#28931543)
Five seconds really is unusably slow, in my opinion. Even a tenth of that is grating. If I want to run a one-off command, I open a new terminal to do so, and close it when I’m done.
Re:s/bash/zsh/g by animal_spirits on Wednesday October 20, 2021 @11:47AM (#28932152)
My pretty extensively customized zsh config with ohmyzsh takes maybe a quarter of a second to load... Maybe I don't have as customized config as I thought because if it is taking a second or more I can't imagine what is being loaded.
Re:s/bash/zsh/g by chx on Wednesday October 20, 2021 @10:48AM (#28931299)
omz is very very heavy weight. Back when there was a freenode and #zsh it was widely hated as only IRC can hate something.

You can source

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

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

without omz anyways.

Re:s/bash/zsh/g by _huayra_ on Wednesday October 20, 2021 @11:37AM (#28932022)
Yes it is incredibly heavyweight, but it's very batteries-included in its approach, which helps zsh newbies get started.

For those who want to shed the heavyweight omz stuff, I recommend zplug [0]

[0] https://github.com/zplug/zplug

Re:s/bash/zsh/g by krinchan on Wednesday October 20, 2021 @04:28PM (#28936038)
Or zgenom[0]. Or if you want to get ESPECIALLY froggy and async with your shell startup, zinit[1]. I ran zinit for years before moving to zgenom. A large swath of electron apps use some weird NPM library to “resolve” your shell environment by kicking up a full interactive shell and then reading the environment variables out of it. zinit messed with that and would hang a lot because of all it’s async loading.

[0] https://github.com/jandamm/zgenom

[1] https://github.com/zdharma/zinit

Re:s/bash/zsh/g by lprd on Wednesday October 20, 2021 @12:07PM (#28932406)
Avoid oh-my-zsh like the plague if you value performance...
Re:s/bash/zsh/g by sqqqqrly on Wednesday October 20, 2021 @07:01PM (#28937967)
Here's a nickel kid. Buy a real computer.