7 ms·
Zshell
- rnd0 3y agoWith bash and all of it's improvements over its' predecessors and rivals (csh), I'm not sure what need there is to throw resources at new shells such as zsh and fish etc? [pulling my tongue out of my cheek, I honestly never have found a reason to use anything other than bash -but that's just me]
- aaplok 3y agoIn fairness, zsh is only newer than bash by a year. Both are about 34 years old.
- aeadio 3y agoBash and Zsh are both just about as old as one another. Zsh came out less than a year after Bash. Both derive most of their improvements from ksh, which is why they look superficially similar and many scripts are cross-compatible. Zsh arguably took the language improvements much further than Bash, ie look at [1] and [2] in https://news.ycombinator.com/item?id=39642678 https://news.ycombinator.com/item?id=39642678. Bash made the understandable but very regrettable decision of being only a superset of POSIX sh, which means it carries along all the footguns, like word splitting by default. Zsh is also eminently flexible and scriptable, with many core features (like most line editor functionality) exposed as hooks that custom scripts can extend or change. Zsh is also notably faster than Bash. It's one of the great disappointments of open source history that Bash largely took off as the default shell everywhere and the default shell scripting language, despite Zsh being superior in just about every way.
- dmd 3y agoNeeds a (1990) tag. It always amuses me when people, to this day, say "eh, not going to use that newfangled zsh, bash was good enough for my forefathers and is good enough for me" - not realizing zsh was released less than a year after bash.
- alyandon 3y agoI tried to give zsh a shot as a bash replacement but ultimately returned to bash. My main pain point was that zsh was really difficult to configure out of the box and a lot of the completions were much slower (cpu/wall time) than the equivalent completion in bash. I'm sure some of that was simply ignorance on my part.
- erhaetherth 3y agoIt still boggles my mind how CLIs are slow as molasses even on high end PCs. I will never understand.
- GuB-42 3y agoBash improved a lot since the early 2000s, when I first assessed my options for shells and settled on zsh. As an interactive shell, zsh did more, and better, than any other shell I tried. Maybe it was slow, but not enough to matter at the time I used it. I guess that bash being the default practically everywhere nowadays made it so that it got a lot of love. For example, it is common to see command line tool come with bash completion files, less so with zsh. Also, while bash got better support where it matters, zsh mostly got bloat in the form of oh-my-zsh and the likes. You don't have to use it, but if you do, you tend to have all kinds of fancy stuff that affects performance. Also, if you want something fancy, you have fish now. I still use zsh (without oh-my-zsh) out of habit, but if I had to start over now, I would probably stay with bash, or maybe use fish, but not zsh.
- soraminazuki 3y agozsh has better completion, command line editing capabilities, and language features. It's not even close. I can port my bash configuration to zsh in mere minutes, but it's impossible to port my zsh configuration to bash. The reason is simple. Bash just lacks so many features. > For example, it is common to see command line tool come with bash completion files, less so with zsh. It's rare for bash to complete anything but filenames. zsh gives me subcommands and flags with descriptions. > Also, while bash got better support where it matters, zsh mostly got bloat in the form of oh-my-zsh and the likes. zsh is a well-maintained project. It makes no sense to ignore that and instead fault them for oh-my-zsh's shortcomings, as if it has anything to do with upstream zsh. zsh doesn't rely on oh-my-zsh for any of its features.
- tmtvl 3y agoI like the path completion in zsh, being able to type '~/.c/x/x', hit tab and have it autocomplete to '~/.config/xsettingsd/xsettingsd.conf' is a lot nicer than `~/.c', tab, tab, add an 'o', tab again, 'x', tab, tab, 's', tab, tab.
- cellwebb 3y agoI’ve been using zsh for a while now and you just blew my mind!
- tmtvl 3y agoEmacs' standard find-file function also does it, and I've since gotten so used to it that it's very irritating when I have to use a piece of software that doesn't complete like that.
- todd8 3y agoThere have been decades of work on file name completion put into Emacs, nothing I’ve seen comes close. Currently I’m using add on packages vertigo, orderless, marginalia, consult, embark, and corfu to handle completion. These packages all work together to produce a crazy good setup, but in the past I’ve used helm, ivy, icicle, and vanilla Emacs. Every one of these open source completion frameworks works great. Of course, I’ll never get back the time spent fiddling with my 1600 line Emacs configuration file.
- tmtvl 3y agoOh man, I've tried using Ivy, but it's terrible. I tried typing '~/.c/r/r' to quickly get to my RetroArch config file, and I immediately got stuck in '~/.cache'. With Vertico it Just Works (R). Icomplete (whose vertical mode is part of Emacs now) can also do it, but I prefer Vertico's UX as the way Return and 'C-j' work in Icomplete is opposite to what I naturally expect and rebinding them doesn't work that well.
- deleted 3y ago[deleted]
- mdaniel 3y agohappy 10000 day <https://xkcd.com/1053/ https://xkcd.com/1053/> to you, I guess, or did its website change or something? although TIL they use SourceForge for git. I'm sure there' s a story there: https://sourceforge.net/p/zsh/code/ci/master/tree/ https://sourceforge.net/p/zsh/code/ci/master/tree/
- kuczmama 3y agoSomewhat related is "Oh My ZSH!" which is basically zsh on steroids, it's always one of the first things I install on a new computer. It gives things like new colors, themes, plugins, and more. Highly recommend you check it out. https://ohmyz.sh/ https://ohmyz.sh/
- zemnl 3y agoI used OhMyZsh! for a long time and really liked it, but now I moved to Starship [1]. However I noticed I still missed some of the "steroids" that OhMyZsh brought so I keep it installed in my system and I only source the plugins I need in the .zshrc: source /usr/share/oh-my-zsh/lib/completion.zsh source /usr/share/oh-my-zsh/lib/directories.zsh source /usr/share/oh-my-zsh/lib/history.zsh source /usr/share/oh-my-zsh/lib/spectrum.zsh source /usr/share/oh-my-zsh/lib/key-bindings.zsh [1]: https://starship.rs/ https://starship.rs/
- jerpint 3y agoThis + ohmytmux is my go to
- HKH2 3y agoDo people script in zsh?
- fiddlerwoaroof 3y agoI do: I find zsh is quite a bit nicer than bash for scripting and tend to write all my personal shell utilities in zsh.
- FroshKiller 3y agoIt's the default shell in macOS, so I imagine quite a lot of people do. Like me!
- aeadio 3y agoZsh is quite a bit nicer than Bash for scripting. For one, parameter expansion doesn't word-split by default, so you don't have to haphazardly quote everything. There's also some really powerful features, like the parameter expansion flags [1] and filename generation (globbing) flags [2] that can be combined to do very flexible things. [3] Zsh also bundles a ton of useful modules that can be used to do things pretty outside the box. Eg, there's a module for creating and controlling a hidden PTY. [4] Zsh also has some quite nice shorthands for basic grammar, like compact loops and conditionals. Eg, you can do: for foo in bar*; do_stuff # you don't need the do..done here for single-line for-loops Also, while Zsh diverges from POSIX sh in some areas (like word splitting), Zsh has sh- and Bash-compatible emulation modes, which can even be mixed together within single scripts (eg functions can set their emulation mode and shell options locally, or files can be sourced or commands run with different emulation modes prefixed). [5] Lastly, Zsh has this weird reputation for being slow, because the configuration frameworks like oh-my-zsh are absolute dogs. But it's actually among the faster shells, with very respectable script performance that's squarely ahead of Bash. [6] Interactive performance can also be fantastic if you use a less hungry framework or write your own config, and Zsh has many tools to improve speed further, like support for pre-compiling source files [7] and pretty good support for async workers. [8] Zsh has also been around about as long as Bash, and runs on every major platform and is available in just about every platform's package manager. So the cliche about Bash being available everywhere is just as true for Zsh. Zsh is honestly a much better replacement for scripting, but Bash benefits from already established traction and by being the default shell on most Linux distros. [1] https://zsh.sourceforge.io/Doc/Release/Expansion.html#Parameter-Expansion-Flags https://zsh.sourceforge.io/Doc/Release/Expansion.html#Parame... [2] https://zsh.sourceforge.io/Doc/Release/Expansion.html#Globbing-Flags https://zsh.sourceforge.io/Doc/Release/Expansion.html#Globbi... [3] https://thevaluable.dev/zsh-expansion-guide-example/ https://thevaluable.dev/zsh-expansion-guide-example/ [4] https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#Zsh-Modules https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#Zsh-... [5] https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html#Shell-Builtin-Commands-emulate https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Command... (see 'emulate' command) [6] https://towardsdatascience.com/comparing-sh-bash-ksh-and-zsh-speed-82a72bbc20ed https://towardsdatascience.com/comparing-sh-bash-ksh-and-zsh... [7] https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Command... (see 'zcompile' command) [8] https://github.com/mafredri/zsh-async https://github.com/mafredri/zsh-async as an example, but also doable in bare Zsh