Show HN: Clamshell- an experimental Python based shell (github.com)
About a month ago I started a suprisingly-not-that tricky project to build an experimental python repl that I could use instead of bash as a daily shell in windows, mac or linux. It"s more hack-for-exploration than a production ready shell, but here it is! Hope somebody finds it anywhere near as interesting to check out as I found making it.
Disclaimer: I know about xonsh and love it (if you haven't heard of it, google it). This project is more pure python and less python and bash interacting - see the readme for more details.
25 comments
[ 3.9 ms ] story [ 65.6 ms ] threadRight now I can do similar stuff, but I often end up doing horrible things like
which is not nearly as elegant, especially for more complicated stuff. Lots of places for issues to sneak in, like I'm pretty sure that splitting the output of ls like I did there gives me an extra null directory at the end of the output, not an issue here but it is one more spot for bugs to sneak in.Of course the other problem with these "super commands" is that they all have to exist in your master shell process. I wonder if you could use something like RPyC to have live python objects that are fully interactable but which live in other processes.
Really cool idea about separate processes- I guess since the shell is its own thing, there's no reason you couldn't write an interpreter in a non-GIL language (like rust or c++) even if the commands where Python. That'd free you up to spawn subprocesses and shells to your heart's content!
I’ve found most of the alternatives have a high (for my use case) learning curve. For real debugging I use VSCode but it’s nice to be able to quickly throw breakpoints around.
https://github.com/pdbpp/pdbpp
If you want you can drop an email to Sam at phin.tech and I can email you if/when it comes out.
https://github.com/google/zx
It's a really dumb solution and can work in any language/environment, so I like it.