5 ms·
I’m going to play around a little bit with this headless mode and see if I can come up with anything interesting! Is there a place y’all hang out or a way you
by williamcotton 2y ago
I’m going to play around a little bit with this headless mode and see if I can come up with anything interesting!
Is there a place y’all hang out or a way you communicate? I foresee needing some guidance in places.
- chubot 2y agoOh yes feel free to join https://oilshell.zulipchat.com/ https://oilshell.zulipchat.com/ -- there is a whole #shell-gui channel . We are mainly developing OSH and YSH now, but it would be nice to work on the interactive shell too The key idea is that OSH and YSH can run "headless" with the "FANOS" protocol (file descriptors and netstrings over unix domain socket), which has a tiny implementations in C and Python The reason we use FD passing with Unix sockets is so that anything that uses terminal still works: ls --color pip install cargo build All these programs will output ANSI color if `isatty(stdout)` is true (roughly speaking). Most people didn't quite get that -- they thought we should use "nREPL" or something -- but my opinion is that you really need a specific protocol to communicate with a shell, because a shell spawns other programs you still want to work. --- Here is a pure Python 3 implementation of the recv() side of FANOS in only ~100 lines https://github.com/oilshell/oil/blob/master/client/py_fanos.py https://github.com/oilshell/oil/blob/master/client/py_fanos.... It uses the recvmsg() binding . I'm pretty sure node.js has that too? i.e. it has Unix domain socket support --- Anyway, thanks for taking a look - we're interested in feedback!
- chubot 2y agoOh also, my feeling of why this may be interesting is if you think "I want to write a GUI for shell, but I can't modify the bash source code to do what I want" That is, the shell itself is a limitation OSH is the most bash-compatible shell by a mile, AND we can easily add new hooks and so forth. I think most stuff can be already done with FANOS, but I think completion is one area that needs some testing / feedback. For example, I imagine that when constructing a pipeline, you might want to complete exactly what's available -- like shell functions that the user has defined ?