-
-
Notifications
You must be signed in to change notification settings - Fork 166
Headless Mode
andychu edited this page Aug 23, 2025
·
28 revisions
Back to Interactive Shell
Oils has a headless mode with osh --headless
, which is meant to divorce the shell and the terminal. You should be able to interact with a shell through a GUI, rather than a terminal.
It uses the "FANOS" protocol we invented, which is ~200 lines of C or ~100 lines of Python. FANOS stands for "file descriptors and netstrings over sockets".
Slogans:
- A shell GUI should have a terminal; it shouldn't be a terminal
- Shell is a language-oriented UI, but that's not the same thing as a terminal-oriented UI
-
Blog Posts tagged #headless
- Interactive Shell Screenshots - the post with a screenshot that I show as a demo. In the web UI, shell input/output is rendered separately from child process input/output
- Oil's Headless Mode Should Be Useful for UI Research (Notes on the HotOS Unix Shell Panel)
- Docs in the Oils Repo: https://oils.pub/release/latest/doc/headless.html
-
#shell-gui
on Zulip has many discussions: https://oilshell.zulipchat.com/#narrow/stream/266977-shell-gui - Shell as an Engine for a GUI or TUI: https://github.com/oilshell/oil/issues/738
- C library (~200 lines): https://github.com/oils-for-unix/oils/blob/master/cpp/fanos_shared.c
- Pure Python 3 library (~100 lines): https://github.com/oils-for-unix/oils/blob/master/client/py_fanos.py
- Go web server, using
fanos.go
library: https://github.com/subhav/web_shell/
- Use
push-registers { foo }
to avoid clobbering$?
,BASH_REMATCH
, and other registers (VM globals).
- Demo of how to pass a pipe, and e.g. dump JSON (is our json builtin stable? Or does
read --json
andread --qtt
make more sense?) - command line option
--source
(global) (or should it be--use
(namespaced) ?) - Document "registers" ?
- More docs on how to implement a headless client. Join
#shell-gui
on Zulip for discussion!
This is a non-FANOS interface:
- web_shell prototype: https://github.com/subhav/web_shell/blob/master/command_server.sh
- descriptor passing would be nice. Uses LD_PRELOAD to trick bash into thinking it's running from a terminal.