A couple of months ago, I took the PowerShell on Linux challenge. I failed that challenge. I couldn’t extend the shell the way I wanted to.
Fast forward to today, I found another shell that I like better. It is based on the ‘es’ shell, which is based on the ‘rc’ shell, which is a plan9 shell which was supposed to “fix” the flaws in bourne.
I heavily modified this shell to give it a reasonable command line experience. I thought I’d share this work here, since it sort of started here in the first place.
It needs some more prompt and completion extensions probably, since it’s not on the same level as the more popular shells (bash, zsh, fish).
What’s your favorite shell feature? (Besides the typical powershell answer of integrating with everything in the microsoft enterprise).
I find the hinting a bit annoying, but I like the completion features of other shells. The help/man page inline w/fish is sort of neat, but I’m not sure I would use it very often. That’s probably what I would do next.
Here’s my history complete in action. I’m typing alt-p to complete the history element. The ‘make’ hist complete is doing the same thing while the history list is being displayed.
Interesting. Really powerfull. It’s more than i’d need and a tad hard to find what you’d want from the looks of it.
My usecase is basically: I’m on that server, editing some files and reloading services to check. When i start typing “vim” the up key goes back through all commands that started with “vim” one at a time.
Not as powerfull, but easier for me to wrap my head around.
The problem with getting accustomed to shells other than bash, much like editors other than vi, is that most hosts don’t have them installed. If you only do work on your personal desktop then go crazy, otherwise it’s kind of a bad idea.
It could compress the list to just those matching the search instead of paging the entire list. I thought about adding another action to do that, like alt-o displays the compressed history list… and alt-p displays the entire list. I sort of like the context in the history, so I can see what I did around the same time.
Yeah, I tried hard to copy the feel of readline in bash. I think I got most of the features, for example, alt-p in bash also does history completion. I tried to extend bash readline rather than replace it.
I can see where you’re coming from and that it would probably work for most people. I’m just a vim guy. I hate hotkey combinations with a passion. I try to never have to press to keys at the same time (German uses a lot of Uppercase, but that’s about it).
It’s just personal preference.
The way i see it: Most shells don’t change the commands you use. They just add features to make your job faster or easier. I have never had a problem switching from ZSH to bash. I just take more time to do some things. But i use both daily, so maybe i’m just accustomed to both?
I suppose I could go full nerd-fonts for the crazy glyphs like powerline9k.
I’ve avoided that simply because my favorite font is an old DEC font which doesn’t have any kind of fancy glyphs.
One other idea I had was to add an event loop to the shell. Most shells have pretty basic read-eval-print loops that block on the terminal input, unlike Node and powershell, which are designed from the ground up to be event processors. There is the “trap” command in bash/zsh which provide asynchronous signalling , similar to an event. The functional style of this shell allows binding functions with a lexical context of evaluation.
In many respects, this shell is the proto-powershell from '93. It provides 3 channels for functions to communicate, just like posh: object, stream, exit-status. In this shells case, the objects are simple lists which map to argc, argv[] well. In the posh case, you can define all sorts of typed entry points.
Es syntax
x = `{cmd} # the byte stream
y = <={cmd} # the list object
if {cmd} # the error status
Bourne syntax
x = `cmd` # the bytes
if cmd; then # the error status