lainchan / λ
Alternate Shells
Dujour · 2025-04-26 12:55
I have been playing with some alternative shells recently. Alternatives shells would be defined as shells that exist outside of the current big 3 (bash, zsh, and fish). I've done some daily driving of nushell for the past few months and while it has some interesting concepts, its fuzzy finding doesn't do it for me.
Have you been using any alternate shells? I am looking at testing out murex, and maybe a few other ones while I'm at it.
Terzibashjian · 2025-04-26 16:57
I've used Common Lisp like a shell, but I'm not sure if that counts.
藤原純一 · 2025-04-26 18:28
I just use the default shell on whatever OS I'm working on (zsh on macOS, dash in Docker containers). These days, I'm wholly reliant on AI to compose shell commands. fuarrrk learning some busted-ass language from the 80s that barely supports real arrays.
Spike Spiegel · 2025-04-27 00:56
>>41928
That command returns 2x the real value. Because of the "+" on "find". No "awk" needed.
Arisu Mizuki · 2025-04-27 06:21
nu is interesting, but I haven't taken the time to learn it properly yet. Something that I didn't like about nu was the absence of built-in job control, but I noticed that recently changed.
https://github.com/nushell/nushell/pull/14883
I'm aware of 3rd party job control tools for nu, but I haven't given them a try.
One alternative shell that I didn't initially like, but it started growing on me is Emacs' eshell. The feature that won me over is its integration with Emacs' tramp which let me cd to remote servers. It feels like having an ad-hoc sshfs that automounts, and it's kinda handy. You can also run interactive elisp functions as if they were shell commands which is nice.
https://www.masteringemacs.org/article/complete-guide-mastering-eshell
The main preconception that I had which prevented me from liking it was expecting it to have bash-like behavior. It's not a Bourne-shell derivative so it's best to go into it expecting it to be its own thing. It's going to be different.
Nell · 2025-04-27 06:39
>>41923
I use whatever the default of the system is. I don't do much shell scripting though, so it doesn't make much of a difference to me.
I mainly use OpenBSD - you could check out ksh93u+m if you're on Linux. I think Plan 9's shell `rc` has also been ported to other systems.
Davis · 2025-04-27 06:53
>>41923
>Have you been using any alternate shells?
I considered switching to PowersHell but it's so (very!) slow and it's not always as convenient as Bash or Zsh. PowerShell basically took 1 step forward and 2 steps backwards at the same time.
I have some PowerShell tips.
* Be sure to disable the telemetry!
>https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_telemetry
* I liked the book Learn PowerShell in a Month of Lunches
>https://www.manning.com/books/learn-powershell-in-a-month-of-lunches
* Be sure to update the help files: Update-Help -ErrorAction Continue ; Update-Help -ErrorAction Continue -UICulture en-US * use Get-Command and Get-Member a lot!
Links:
* https://www.youtube.com/@PowershellOrg/videos
* https://www.powershellgallery.com
* https://github.com/vexx32/PSKoans
________
I also considered looked into Lisp-like shells, like CLisp As SHell aka CLASH.
>https://clisp.sourceforge.io/clash.html
I have researched other options:
>scsh (Scheme Shell): https://github.com/scheme/scsh (old versions are at https://scsh.net/)
>LUSH (Lisp Universal Shell): https://lush.sourceforge.net/doc.html
>eshell - part of GNU Emacs. Read relevant parts from Mastering Emacs site!
>SHCL: https://shcl.io/
>lish: https://codeberg.org/nibbula/yew/src/branch/master/lish
>flesh: https://gitlab.com/whom/relish
quote · 2025-04-27 07:16
>>41925
this is the superior gentleman's choice.
I've been using guile.
I was considering checking out scsh for scripting.
Meddler · 2025-04-30 09:28
>>41935
You can see PowerShell in action, here => https://learn.microsoft.com/en-us/shows/getstartedpowershell3/02
There are ⑨ parts. I had to refresh the page to be able to select the next part after watching the video.
Mentat · 2025-04-30 15:48
>>41923
I am rolling fish everywhere and use it on my home station. Long ago tried oh my zsh! and it sucked. fish's the only shell that has decent autocomplete and a much more comfy syntax than zsh
William Holtzer · 2025-04-30 23:27
>>41933
I used eshell for a bit and parts were nice, but some functions and syntax were a bit different from bash and I got tired of figuring out the differences. Plus its a bit slower.
I wish an operating system would have a scripting language as the main shell and configuration format.
Bob Arctor · 2025-05-01 05:12
honestly i feel like no one has done shells right to this day.
bash (like most unix shells) is garbage, it's a huge hack
powershell was conceptually a step in the right direction but they overdid it and it became a monstruosity, it's basically the C++ of shells.
we're missing some middle ground here.
Lady Jessica · 2025-05-01 05:58
>>41979
imo a shell is kinda supposed to be a hack, something that basically just allows you to start a process conveniently and have some light scripting capabilities (loops, conditions, detaching processes, etc.), it's not supposed to have classes like PowerShell
Otto Normalverbraucher · 2025-05-01 10:32
>>41981
that's what i mean by middle ground.
i certainly dont want the object oriented insanity of pwsh but i also dont want my shell to soykaf itself because of fuarrrking whitespace or to be unable to handle 2D arrays.
Von Neumann · 2025-05-01 12:06
I tried konsh once, it's basically python as a shell.
I set it up, used it for a day or two, then figured that it didn't give me anything over bash so I gave it up.
FILLER · 2025-05-01 23:32
>>41923
>>41933
Now that it has built-in job control, I decided to throw myself into the deep end and daily drive nushell for a while. I spent a few hours porting over the essential bits of my zsh configuration, and I'm satisfied with the results so far.
~/.config/nushell/config.nu
# Help: https://www.nushell.sh/book/coming_from_bash.html
## Aliases
alias e = emacsclient -n # current frame
alias ef = emacsclient -nc # new frame
alias et = emacsclient -nw # terminal
## Directory Changers
alias G = cd (ghq list --full-path | fzf)
alias M = cd (^find ~/Music -type d | fzf)
alias P = cd (^find ~/Pictures -type d | fzf)
alias V = cd (^find ~/Videos -type d | fzf)
alias dl = cd ~/Downloads
alias tordl = cd ~/TorDownloads
## Other
alias ll = ls -l
## Directory bookmarking system (mark/jump)
## https://mbork.pl/2017-03-04_Bookmarking_directories_in_Eshell
def marks [] {
ls $env.MARKPATH | where type == symlink | get name | path basename
}
def mark [target: string] {
mkdir $env.MARKPATH
ln -i -s $"(pwd)" $"($env.MARKPATH)/($target)"
}
def --env jump [target: string@marks] {
cd -P $"($env.MARKPATH)/($target)"
}
## Host-Specific Config
# const host_config = $"host.(sys host | get hostname).nu"
# source $"($host_config)"
~/.config/nushell/env.nu
$env.EDITOR = "emacsclient -nc"
$env.GHQ_ROOT = $"($env.HOME)/src"
$env.LS_COLORS = (vivid generate nord)
$env.MARKPATH = $"($env.HOME)/.marks"
$env.config.buffer_editor = ["emacsclient", "-nc"]
Maybe this will be of use to emacs users out there curious about nushell.
J.C. Denton · 2025-05-02 07:37
I made an alternative shell myself! But it's kinda doggers. Maybe look into elvish and oil?
Hacker · 2025-05-02 12:18
>>41988
I really liked the notation nushell used for setting up tab completions. With this configuration I could hit:
jump <TAB> and then the marks function would be called to generate a list of tab completions. I've setup similar things in zsh, but I'd have to refer to my notes to remember how I did it. This, on the other hand, I don't have to think too hard about.
Roy Batty · 2025-05-08 21:31
>>41988
I have a few minor updates for Emacs users interested in nushell.
~/.config/nushell/env.nu
$env.EDITOR = "emacsclient -c" - "-nc" was wrong.
- $env.EDITOR needs to block so that commands like `crontab -e` can know when you're done editing.
- Also $env.config.buffer_editor can be removed. That might have been a setting for an older version of nushell that isn't meaningful anymore.
Another more serious problem was that there are a few things in Emacs that assume a Bourne-compatible shell. For example, a lot of the project-* functions like project-find-file run shell commands under the hood, and if nushell is your shell, it doesn't work.
My solution to this was to explicitly tell Emacs to use a Bourne-compatible shell when it wants to run things under a shell.
(setq shell-file-name "/bin/bash") ; or anything Bourne-compatible This will make Emacs' project functionality work again.
Boris Grishenko · 2025-05-09 09:32
>>41923
i don't get the purpose of the lisp shells. how is it different than just starting the lisp repl or writing my scripts directly in lisp?
The Phantom Phreak · 2025-05-09 10:12
>>42083
They are shells, meaning they serve to run system commands. Talking about lish here. There is also a bit of syntax sugar to remove superfluous parenthesis and make the syntax more similar to POSIX shells. Lisp lacks a pipe operator btw.
Examples from the manual:
Lish> echo hello world | wc
1 2 12
Lish> (+ 1 2 3)
6
Lish> list 9 3 29 24 23 7 | (sort *input* #'<)
(3 7 9 23 24 29)
Spooky · 2025-05-09 14:14
>>41979
as a side project, have you thought about writing your own shell?
maybe start by speccing out some basics. if there was an ideal shell, suppose it was called lainshell, what would it look like to you?
>>41989
is it on git?
overriding · 2025-06-07 07:16
>>41988
If you use nushell and emacs, here are a few functions you can put in your ~/.config/nushell/config.nu to manage multiple emacs servers.
def emacs-servers [] {
ls $"($env.XDG_RUNTIME_DIR)/emacs" | where type == socket | get name | path basename
}
def xe [server: string@emacs-servers, ...args: string] {
emacsclient -n --socket-name=$"($server)" ...$args
}
def xef [server: string@emacs-servers, ...args: string] {
emacsclient -nc --socket-name=$"($server)" ...$args
}
def xet [server: string@emacs-servers, ...args: string] {
emacsclient -t --socket-name=$"($server)" ...$args
}
- The really fun part is the emacs-servers function which lists the currently running emacs instances that are in server-mode.
- The shell function xe, xef, and xet use the emacs-servers function to feed tab completion on their second argument.
- The rest of the arguments use standard tab completion which defaults to files relative to the current directory.
Examples:
# Start some emacs instances.
emacs --daemon=one
emacs --daemon=two
emacs --daemon=three
# Open a file.lisp using server "one" in a new frame.
xef one file.lisp
# Open .editorconfig using server "two" in the terminal.
xet two .editorconfig
# Open ~/.tmuxrc in server "three"
xe th<TAB> ~/.tmuxrc
roll · 2025-06-07 08:38
>https://github.com/justin2004/apl_in_the_shell
This got me thinking. Is there J-like language that can be used as your login shell?
>>41923
I was wondering why nobody uses Tcl + tclsh as login shell. It works like this:
>All valid Tcl code is ran like normally in Tcl scripts
>tclsh will look up a program from your $PATH If you type something that's not valid Tcl code.
>if it isn't valid Tcl code and it can't find a exe from your $PATH, you will get an error
But then I read:
>https://wiki.tcl-lang.org/page/Is+tclsh+or+wish+suitable+as+a+login+shell
And it seems that there is some work to do before it would be any good.
Erik Johansson · 2025-06-18 00:03
>>41923
I have been using tkcon a fair amount lately but I would not recommend it as a shell for the most part, but it is pretty great for learning tcl/tk. I just use bash for the most part, the times it actually falls short for me tends to be the times I am trying to use the shell for things which shells just are not good for. The fancy output of nushell and its ilk sometimes gets me curious but that fancy output sure eats a lot of screen space, the one time I played with it I found myself scrolling up and down far more than I care to.