April 2021: This is OLD (2018). See Capers
(Back to Shell Autocompletion)
Related: Coprocess Language Support
stdin, stderr, EOF, etc.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.
We do not control every print statement in the program.
print() statement in a Python program to print(msg, file=fcli_out).Just knowing sending stdin/stdout/stderr
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.
dup2()? Or it sounds like you can do
setOut(...)#!/bin/sh
exec fcli-invoke --fcli-socket /tmp/redoifchange -- redo-ifchange "$@"
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?
See https://github.com/oilshell/shell-protocols/tree/master/coprocess
recvmsg() a file descriptor?