68 lines
2.6 KiB
Plaintext
68 lines
2.6 KiB
Plaintext
+++
|
|
title = "Nushell first impressions"
|
|
date = 2024-03-01T11:34:04-06:00
|
|
draft = true
|
|
+++
|
|
:caution-caption: pass:[<span style="font-size: 2em">☠</span>]
|
|
:important-caption: pass:[<span style="font-size: 2em">❗</span>]
|
|
:note-caption: pass:[<span style="font-size: 2em">✏️</span>]
|
|
:tip-caption: pass:[<span style="font-size: 2em">💡</span>]
|
|
:warning-caption: pass:[<span style="font-size: 2em">⚠</span>]
|
|
:toc:
|
|
:toclevels: 6
|
|
|
|
Ive been trying out a bunch of new shell utilites lately,
|
|
switching up my shell, terminal multiplexer, and even experimenting with my editor.
|
|
Today, Id like to focus on my experiments with my shell.
|
|
|
|
== My old setup
|
|
|
|
Before this, I had been using a minimal zsh setup for a long time,
|
|
with only built in features and a handmade prompt.
|
|
Zsh is a good shell, probably one of the best posix shells out there,
|
|
and I still use it when a posix shell is needed.
|
|
|
|
However, I got tired of the endless footguns that posix shell scripting imposes,
|
|
easy to make errors around quoting, word splitting, and escaping,
|
|
the sort of thing that makes https://www.shellcheck.net/[shellcheck] necessary.
|
|
|
|
I played around with fish for a few days,
|
|
but it had many of the same fundamental design choices, mainly, being 'stringly typed',
|
|
that made posix shells such a displeasure to work with.
|
|
|
|
== A Nu shell
|
|
|
|
While googling around for alternative shells, I stumbled across https://www.nushell.sh/[nushell],
|
|
a shell that claimed to work around structured data instead of just strings.
|
|
This was *exactly* what I was looking for, and I installed it immediately.
|
|
I decided to work with it for around a month,
|
|
give myself enough time to really use it,
|
|
see not only how it felt with ordinary usage,
|
|
but to give myself time and opportunity to construct a few pipelines and scripts in it.
|
|
|
|
All that said, the month is up, and ive been collecting examples,
|
|
thoughts, and some criticisms along the way.
|
|
|
|
== Piping structured data
|
|
|
|
// show some examples of grouping, sorting, etc without endless invocations of `cut`.
|
|
|
|
== Parsing non-nu tools
|
|
|
|
// show parsing initcall_debug logs, and how it then lets one do analysis on it
|
|
|
|
== Defining custom commands
|
|
|
|
// show the basic syntax for custom commands
|
|
|
|
=== Built in arg parsing?
|
|
|
|
// show syntax for custom args, and how it leads to auto completion and help generation.
|
|
|
|
== Error messages
|
|
|
|
== Whats not there yet
|
|
|
|
// explain some limitations, tools that assume the existence of a posix shell (esp files one is instructed to source)
|
|
// also explain the limitations where nushell scripts cannot pass structured data, but are treated as external commands, therefore their usefullness in a pipeline is limited.
|