April 2021: This is OLD (2018). See Capers

(Back to Shell Autocompletion)

Related: Coprocess Language Support

Design Constraints

The initial Coprocess Protocol Proposal would require too much modification to existing tools. It was more like my 2012 projects fly and xmap. That only handled command line tools that behaved in a particular way.

Observations

Both of these should work, and they are different:

foo.py < in.txt >out.txt 2>err.txt

foo.py < in.txt >out-err.txt 2>&1

In the first case, the process is started with three files connected to its 3 descriptors.

In the second case, the process is started with two files connected to its 3 descriptors.

Configuration for FCLI Binaries

What Clients Look Like

Clients for Shells Without FCLI Support

#!/bin/sh
exec fcli-invoke --fcli-socket /tmp/redoifchange -- redo-ifchange "$@"

Oil Client

We can save the exec() of fcli-invoke. Just build it in. Maybe that should just be a builtin so it can behave both ways?

TODO

Prototype

See https://github.com/oilshell/shell-protocols/tree/master/coprocess

Open Issues