Why Sponsor Oils? | source | all docs for version 0.22.0 | all versions | oilshell.org
A GUI or TUI process can start Oils like this:
osh --headless
and send messages to it over a Unix domain socket. In this mode, the language and shell state are decoupled from the user interface.
This is a unique feature that other shells don't have!
Note: This doc is in progress. Join the #shell-gui
channel on
Zulip for current information.
The UI process should handle these things:
The shell process handles these things:
FANOS stands for File descriptors and Netstrings Over Sockets. It's a control protocol that already has 2 implementations, which are very small:
List of commands:
EVAL
. Parse and evaluate a shell command. The logic is similar to the
eval
and source
builtins.
TODO: More commands.
You may want to use commands like these to draw the UI:
echo ${PS1@P}
-- render the promptecho $PWD $_
-- get the current directory and current statusYou can redirect them to a pipe, rather than displaying them in the terminal.
Remember that a fundamental difference between a REPL and a GUI is that a GUI shows state explicitly. This is a good thing and you should take advantage of it!
See client/headless_demo.py. This is pure Python code that's divorced from the rest of Oils.
Feel free to edit these pages: