6 ms·
As another commenter pointed out, while Fish has some nice out-of-the-box features, they’re all achievable in Zsh with a few lines of plugins. And did you know
by kbd 5y ago
As another commenter pointed out, while Fish has some nice out-of-the-box features, they’re all achievable in Zsh with a few lines of plugins. And did you know Zsh has a short for loop? Along with fantastic plugins like fzf-tab, I don’t see a reason to use anything else right now.
Though, I’m keeping a very interested eye on Nu shell. They’re doing a lot of stuff right, and I expect it will become a very useful scripting language in its own right even when not used full-time as a shell.
- sprash 5y agoMany of the features are also achievable with pure bash with ble.sh (https://github.com/akinomyoga/ble.sh https://github.com/akinomyoga/ble.sh).
- deleted 5y ago[deleted]
- gogoyubari 5y agoI find it amusing when people are discussing all these new shells and features, yet everytime I see someone letting them know they can do these exact same things in bash, there's absolute silence. It's not the first time I see ble.sh being recommended here with no reactions from the community whatsoever. As for fish, I've used it for a few weeks. Not having POSIX compatibility and GNU readline shortcuts made work much, much harder.
- pxc 5y ago> Not having [...] GNU readline shortcuts made work much, much harder. That's weird. Fish has all of the GNU readline shortcuts OOTB and has for as long as I can remember
- pxc 5y agoBle.sh seems pretty cool. The path hacking it does on readlink doesn't work right and causes the CNF handler to launch on NixOS. I guess it does the PATH hacking based on whether the system is GNU or not so that it can get `realpath`/`readlink -f`-like behavior even on systems that don't natively have that because they include *BSD coreutils. That might not behave as expected (and is unnecessary) on my macOS systems, either, since I like to keep GNU coreutils (with no `g` prefixes on the executable names) on my PATH there (heresy, I know). It's also noticeably slower, to the point that there's a bit of jitter as I type. It's pretty cool, though. If it's any better after I patch the readlink PATH hacking out, maybe I'll configure it for bash on my systems.
- legutierr 5y agoA recent demo of Nushell given a couple of weeks ago: https://media.handmade-seattle.com/nushell/ https://media.handmade-seattle.com/nushell/
- ghostly_s 5y agoOh wow...finally someone is bringing the great ideas of Powershell to unix. Can't wait to see how this turns out.
- pxc 5y agoYou can run PowerShell on Unix already, but imo it is too slow for interactive use. Getting it to act like a Fish makes it very, very slow
- Aloha 5y agoI can't imagine it being any slower then it already is out of the box.
- exyi 5y agoBut I think it's quite good for scripting. You can call any system command as easily as in bash while being able to use variables for not just strings. I'd never use it as interactive shell, of course :] Also... the script will then run only on my machine as most Linux systems don't have powershell and most Windows don't have the Unix commands I still use all the time.
- pxc 5y agoYeah, I agree that PowerShell is great for scripting. I don't do that much scripting on my personal Linux systems that really calls for PowerShell, but I like using PowerShell for hitting HTTP APIs or processing structured data at work. > Also... the script will then run only on my machine as most Linux systems don't have powershell and most Windows don't have the Unix commands I still use all the time. Hahahaha! Oof. It's more work, but when I use PowerShell, I try to use pure PowerShell, both for aesthetic reasons (cleanliness, ‘portability’) and just in order to practice and learn more PowerShell APIs along the way.
- nerdponx 5y agoZsh has become an indispensable power tool for me. I am interested in other shells (especially PowerShell), but Zsh is now embedded deep in my brain, next to Vim and Python, and I doubt I will ever seriously migrate away. That said: what do you like about Nu shell specifically?
- kbd 5y ago> what do you like about Nu shell specifically? A whole bunch of things: 1. abandonment of POSIX shell syntax. We can do better. I'm happy with Zsh being POSIX-compatible, and that will always be there. 2. a focus on structured data. Nu basically has hierarchical dataframes built-in, along with lots of facilities for their manipulation. There have been a few other attempts at this but the benefits are obvious. Rather than figuring out how to `awk` your way through whatever text output a command generates, command output in Nu is structured and everything can be handled in orthogonal ways. 3. modern conveniences built-in, like syntax highlighting, and AFAIK they want to include features like "do something when you cd into a directory" that we currently need more tools for (i.e. direnv, which I highly recommend!) 4. serious technology. The people behind it are experts and JT has been showing off (https://youtu.be/3o8b_QcrFHc https://youtu.be/3o8b_QcrFHc) the engine that enables trivially parallelizable loops. No more need for `xargs`. 5. I hesitate to mention "made in Rust" as a feature, but using a modern language for core infrastructure does matter.
- kbd 5y agoI'll put it this way: Nu shell seems perfectly supportive of my philosophy that a shell is basically a REPL for a computer, and they're taking the ergonomics of an interactive REPL along with the programming language that powers that REPL seriously. The thing is, there's currently NOTHING GOOD for "shell scripting". Shell sucks (yes it does), so for anything more than very short things I'd rather write Python. But Python sucks for shell-like things, parallelization, it has slow startup, and you also can't do things like put environment variables into your session or change the working directory, so you often wind up writing shims (eg. Broot's br alias - https://dystroy.org/broot/install-br/ https://dystroy.org/broot/install-br/). Yes I've looked at Xonsh but maybe the additional syntax is offputting to me. Like, I wouldn't use it as a shell over Zsh (how's Xonsh's fzf support? I don't know, but I know everything's going to support Zsh), and I dunno if I want to use its syntax extensions over just Python. Though It's always on my list of things to re-explore, and maybe it'll click one day. But it being based in Python makes it feel slow (I wrote my prompt in Zig to get it to be fast...) This is relevant to mention: I wrote a small Python library (https://github.com/kbd/aush https://github.com/kbd/aush) that's basically a DSL for subprocesses, so it tries to make it more convenient to do shell-like things. I find it preferable to shell or Python alone most of the time. Here's an example of its use in my script that creates a new Python project: https://github.com/kbd/setup/blob/master/HOME/bin/create-python https://github.com/kbd/setup/blob/master/HOME/bin/create-pyt... I haven't figured out a convenient way to implement shell piping well with Python's pipe operator, or pass through interactive output directly (so things that "update" the display, like poetry and npm don't behave the same as they do interactively) so it's still .9 status, but it works really well for what it is, and you can always write "regular Python" along with it. Anyway, Nu seems to be an attempt to put a "real" programming language REPL in my shell, from people who have serious language experience, so I'm hopeful it'll be great.
- rainingmonkey 5y ago> while Fish has some nice out-of-the-box features, they’re all achievable in Zsh with a few lines of plugins. The point of fish is that there is no configuration required. You don't have to learn to configure it, you don't have to be part of "the community" to learn which plugins to use, you'll be able to sit in front of any fish prompt and have it work as expected without having to move dotfiles around.
- kbd 5y agoThat's a cool argument for Fish for beginners. When you spend thousands of hours in a shell that doesn't matter as much. I don't see any benefit for someone who has Zsh set up well, but yes you do have to google once how to configure auto-completion and so on.
- ViViDboarder 5y agoProbably little for anyone who has any shell “set up well”. Just if they are tired of spending time tweaking things and would rather more capable out of the box experiences so they can benefit from features added to the core shell without hunting for plugins. I use Fish, however I also use Vim and do the plugin hunt there. I enjoy it, but I’m glad to not be doing it for both my environments.
- kbd 5y agoComparing the "plugin hunt" between vim and zsh is a bit much. I use three for Zsh, just syntax highlighting, autosuggestions, and fzf-tab. I don't use a Zsh plugin manager.
- bscphil 5y ago> The point of fish is that there is no configuration required. I think it would be more accurate to say that the point of fish is that there is no configuration allowed. If you don't like the out of the box configuration, I would say configuration is still required, but it's unfortunately not available. If you happen to like every single decision the developers made, then I admit having no configuration does mean you end up with a simpler, faster, more maintainable shell.
- user-the-name 5y agozsh has this absolutely ridiculous case of feature shyness. It has tons of great features, which it goes to great lengths to hide from you for some indecipherable reason.
- opk 5y agoThe reason is to preserve compatibility for everyone's configuration that they carefully built up over decades. It's quite hard to change things to enable some new thing without annoying many users. The last time that was tried was in the '90s and there are still zsh developers around who experienced the fallout. I value the fact that my shell doesn't change on me without warning like many GUI desktop environments. In recent years the existence of frameworks like oh-my-zsh has contributed further to this situation because it has separated the detailed configuration from the base zsh project. It's a pity omz doesn't enable more really. Many things it does are not really useful unless you take the time to actually learn them. A lot of plugins just define aliases but if you don't know what they are, they just sit there unused.
- user-the-name 5y agoWell, yeah, this is the problem. Throw new users under the bus in favour of old users.
- meribold 5y agoI'm usually happy to put some effort into configuration upfront as a new user if it buys me the peace of mind that I won't be thrown under the bus later. OTOH, I recall some classmates being unaware that Vim supports syntax highlighting because the version that was installed on our lab computers didn't enable it by default (this was about five years ago), which also seems like a regrettable outcome.
- GrinningFool 5y agoThanks for that, fzf-tab was the last missing piece in my setup.
- kbd 5y agoNice. Yeah it works great. I have an extensive set of git aliases. Yesterday I was merging a branch with `gmn` (`git merge --no-ff`, which is actually an alias to `g mn`, where `g` is an alias to git of course) and it gave me a fuzzy find of my branches through all the aliases. Edit: also things like `kill`. `kill [tab]` gives you a fuzzy-find list of all your processes so it's way faster to use than ps | grep.