Skip to content
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

Links

Code

Tips

  • Use push-registers { foo } to avoid clobbering $?, BASH_REMATCH, and other registers (VM globals).

TODO

  • Demo of how to pass a pipe, and e.g. dump JSON (is our json builtin stable? Or does read --json and read --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!

Other

This is a non-FANOS interface:

Clone this wiki locally