1. 15
  1. 1

    Your notes on headless mode / shell GUIs make me think of Jupyter notebooks, as well as GUI debuggers. I would definitely love having those for shell.

    1. 2

      Yes an interface like Jupyter is what the headless mode is meant for!

      There is actually a Jupyter bash kernel somewhere, and I looked at the source code once, and a few people pointed it out. However I don’t think I ever found anyone who really uses it.

      I believe that’s because it has a very coarse integration, i.e. writing to bash over stdin and stdout. This will make running external commands problematic because they won’t be able to detect a terminal and display ls --color, etc. It also makes handling the prompt and displaying errors pretty basic.

      The headless mode solves that problem. So it’s basically a better version of that, and now I wonder if a literal Jupyter kernel for Oil can be written with this functionality. Originally I was imagining something “Jupyter-like”, but I think you could probably use Jupyter itself too.

      The other benefit is that you can write a headless shell GUI in Rust, Swift, C++, Go, etc.! All the people who didn’t like Oil’s use of Python now have no excuse for now building on top of it :) As far as I know, this is the only shell, POSIX or otherwise, that exports such an interface. It’s still in its early stages and I need feedback! Please join #shell-gui on oilshell.zulipchat.com if you’re interested in building something like this :) A basic version can be done pretty easily, and there are existing demos.