← Back to context

Comment by oguz-ismail2

2 days ago

Colorful outputs and elaborately decorated error messages are cool but maybe it shouldn't deviate that far from POSIX shells.

    $ trap '' chld
    $ nu -c test
    Error: nu::shell::io::uncategorized_error
    
      × I/O error
      ╰─▶   × failed to get exit code
    
       ╭─[source:1:1]
     1 │ test
       · ──┬─
       ·   ╰── Uncategorized error
       ╰────
    
    $

There are other options if you want POSIX. But nushell just does things differently (and in a much more sane way with pipes).

Why would you want `test -e "$foo"` when you have `$foo | path exists`? Why `test -n "$foo"` when you have an actual == comparison and pattern matching expressions? And you don't have to worry about quoting things just right in any of the situations.

Yes, you need to learn a little bit of a new thing. You can even implement a test function itself if you really want to. But sometimes it's nice to just dump the legacy baggage.