Live data from Hacker News

Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

news.ycombinator.com

111–120 of 146 posts

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#111
post #109

I use `fish` as my main shell. It's closer to POSIX than eshell or oil, but it's definitely not POSIX. Personally, the main thing I like about it is that I can't copy paste bash commands. It forces me to read and understand and then convert. It also has some quality of life stuff I really like. I think next time I'm just going to go back to ZSH though as I feel I have learnt enough from the experience of using it tha…

When there's something called deadline that's no longer feasible

    bash -c "" # to run some bash inline
or just

    bash -l # to jump to a bash shell

And that's not really a deadline issue. Sounds more of a planning one or an issue of not knowing your tools.

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#112
post #6

I decided last year to bite the bullet and learn Powershell. I think I will no longer have to wonder if there is a better option anymore.

What makes it good?

To elaborate on "piping object instead of a string" Powershell just has lots of quality-of-life features. I think the fundamental problem these days with the shell "do one thing and do it well" concept is that nothing in traditional posix outputs structured data, so every single command and script is a mess of cobbled-together ad hoc parsers and sorters. In Powershell all the builtins emit structured data so there's no need to, for example, write a regex to parse out the mtime of a file. You just do `$file.LastWriteTime`.

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#113
post #27

Earlier quoted context omitted.

> Enlighten me if this I missed the point of Powershell. Plain-text has gotten annoying to me now (having to shell out to grep, cut, and awk is very meh). What's your pain point when trying to use powershell?

What I feel Powershell does not give: short and simple command names, little syntax, and return values that are interpretable at a glance. And there's muscle memory of course, that's on me!

For me I genuinely think Powershell is fewer keystrokes than the equivalent terse bash. A lot of this is a question of heavily using history and editing old commands rather than writing new ones. And the old commands are legible so it's easy to tweak on the fly. Tab completion/history completion are really powerful. (You do need to enable PSReadline though, which is not out-of-the-box.)

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#114

I use `fish` as my main shell. It's closer to POSIX than eshell or oil, but it's definitely not POSIX. Personally, the main thing I like about it is that I can't copy paste bash commands. It forces me to read and understand and then convert. It also has some quality of life stuff I really like. I think next time I'm just going to go back to ZSH though as I feel I have learnt enough from the experience of using it tha…

I've been using fish for at least a decade. While I can't simply run bash commands, I can easily drop to a bash shell and run anything.

The defaults and features are great.

Scripts I also write in bash, sh, or python for compatibility. It's not much of an issue.

I do remember something that used to break in my setup, but since I'm always in tmux, instead of changing the default shell (chsh -s), I just set the default for tmux to be fish.

    # set shell
    set -g default-shell /usr/local/bin/fish

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#115
post #80

Earlier quoted context omitted.

How is nushell for interactive use? Prompt configuration, stuff like that? Also, how stable is it? Especially when interacting with weirder stuff like tmux, vim, ncurses apps?

I would say interactive use is good. Not hard to configure prompts. Stability (in the sense of not crashing) is decent, it's been a long time since I've crashed Nushell. We do get the occasional crashing bug filed but most of those are in areas like our completion engine rather than interacting with external tools. OTOH, command design and language are not entirely stable; we are still pre-1.0 and we do make breaking…

Thank you! I've been using Nushell for a couple of weeks and at this point I don't see myself going back. Modern configuration. Great interactive usage (structured data, mostly!). I thought I'd like it, but more so than expected so far. The one shortcoming I've encountered so far is that some built-in functions seem to buffer all their input before producing any output, meaning I can't e.g. tail + filter logs. A fairly simple example:

    journalctl -xefu systemd-networkd-wait-online.service | lines | filter {|in| $in =~ 'start'}
only produces output when I interrupt (ctrl+c). Is this expected?

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#116
I spend most of my time in #!/bin/ash and while I could install bash on everything using ash reduces my use of bashisms [1]. I stick with ash or sometimes bash so that my skills and habbits albeit not perfect are transferable to any system belonging to almost anyone or any company.

[1] - https://teddit.sethforprivacy.com/r/linux/comments/1h13g8/ba...

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#117
post #80

I've been using nushell for the past year, and I love it. For a while I kept bash as my login shell and had nu as my default command in tmux. This had the advantage of allowing a bunch of environment setup to run in bash and get inherited, which allowed my overall setup to be more vanilla (and also nushell doesn't have any kind of job control, so something like tmux is probably a must). About two months ago I promote…

How is nushell for interactive use? Prompt configuration, stuff like that? Also, how stable is it? Especially when interacting with weirder stuff like tmux, vim, ncurses apps?

> How is nushell for interactive use? Prompt configuration, stuff like that?

Prompt configuration is good... you define commands for the left and right prompt, as well as variables for vi mode indicators (the line editor's vi mode is mostly complete, I'm happy with it). You can also set the cursor shape based on vi mode. Also https://starship.rs works well.

There are hooks for running commands on events like changes to environment variables, which is how you implement support for things like version managers (i.e. on change to $PWD, run whatever).

Nushell parses pipelines upfront, so the error messages are often very precise and useful, and arrive before any damage has been done. This is fundamentally different to how you might expect pipelines to work, so its difficult to compare like for like (... it's great, though).

There's a built in fuzzy finder for commands, completions and history, as well as the line editor visually showing matches against partial commands (a trend which I think started with fish). I do miss some of the history search magic that's possible with zsh plugins — specifically using vi movements to incrementally match more of those visual completions from history.

Completions for external programs have gotten good. If you set up carapace as a completion provider, then most things on the happy path work well (based on bash completions). Edge cases can be understandably buggy... I've noticed that completions for aliases are a bit unpredictable, but I haven't looked into it enough to know whether this is nushell or carapace.

Finally, the automatic generation of help and completions for nushell commands (including your own custom commands) is excellent and one of my favourite features. I'd encourage anyone to look up the docs for custom commands.

> Also, how stable is it? Especially when interacting with weirder stuff like tmux, vim, ncurses apps?

I use tmux and vim, and I've had almost no issues. The only thing that comes to mind is the lack of job control, which means you need to remap ctrl-z to stop vim from getting into a weird state where it can't actually background itself.

Another thing (which isn't nushell's fault at all) is if you change your default shell, many programs will expect that to correspond to a posix shell. For example, after changing my login shell I had to run around explicitly setting my shell to bash in a bunch of places, including vim.

Also every now and then I'll find another oddball command that acts up. For example I noticed that `go test ./...` didn't work without quoting the (admittedly strange) `./...` argument. Later it started working without the quotes after a nushell update, but that's the kind of thing to watch out for.

And another kind of stability: nushell has regular breaking changes. I think this is fine, because it's a fast-moving project which I'm only using locally, and this allows it to evolve quickly (I get excited to read the change notes). But this does make it harder for people who are trying to support nushell from their projects... and so I think naturally the responsibility to keep anything working has to lie with the user. If you are comfortable with that (which I am) then I think it's a good deal.

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#118
Fish is very mature at this point, well supported by other tools (i.e., it's common for the supported shells to be bash, zsh, and fish), and has been inching towards a shallow level of bash compatibility. Its history and suggestion features are also fantastic.

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#119
post #75
post #36

I'm using Fish for years, tried Nushell recently, but it didn't click for me. While I like the principle of data being more than just plain text, it probably was just too alien to me. A few here said they don't use Fish or another shell due to compatibility issues, but I wonder what the problem is: If I want to use a script written for another (POSIX) shell, it most likely has a shebang (or I can add it), so it will…

Mostly it's because you can't copy and paste stuff from blogs or Stack Overflow.

but you can just run `bash`, paste the command, and then `exit`?

Re: Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?

#120

Earlier quoted context omitted.

I would say interactive use is good. Not hard to configure prompts. Stability (in the sense of not crashing) is decent, it's been a long time since I've crashed Nushell. We do get the occasional crashing bug filed but most of those are in areas like our completion engine rather than interacting with external tools. OTOH, command design and language are not entirely stable; we are still pre-1.0 and we do make breaking…

Thank you! I've been using Nushell for a couple of weeks and at this point I don't see myself going back. Modern configuration. Great interactive usage (structured data, mostly!). I thought I'd like it, but more so than expected so far. The one shortcoming I've encountered so far is that some built-in functions seem to buffer all their input before producing any output, meaning I can't e.g. tail + filter logs. A fair…

Ahh, streaming. This is an area I've been working on; there are still lots of places where we collect data when we should stream it instead. In general, if you think "that should be able to stream" but it doesn't, that's probably a bug and worth filing an issue.

I can reproduce your issue, I suspect that `filter` is collecting its input when it shouldn't. It's not totally clear why from looking at the code.

If you can file an issue that would be appreciated, if not I'll try to do so later today. We have a tag for streaming issues: https://github.com/nushell/nushell/issues?q=is%3Aissue+is%3A...

Post reply on HN