3 ms·
A couple weeks ago, `david_chrisnall` on lobste.rs talked about pipe content negotiation [0]. Here is the relevant paragraph: """ Pipe content negotiation is
by abetusk 5y ago
A couple weeks ago, `david_chrisnall` on lobste.rs talked about pipe content negotiation [0]. Here is the relevant paragraph:
"""
Pipe content negotiation is a simple protocol modeled
on the OpenStep drag-and-drop protocol, implemented as
three ioctls. The sender issues a blocking ioctl to
advertise a set of things that it can produce, the
[receiver] issues a blocking ioctl to receive this
list and a second (non-blocking) one to select the
one that it wants to use. If the sender does a write
before content negotiation, the receiver’s ioctl
unblocks and returns an error, similarly if the
receiver does a read before completing content
negotiation the sender unblocks and returns an error.
This lets you establish a pipe between two processes
that can negotiate a content type but also fall back
to whatever your default was if neither end supported
it.
"""
[0] https://lobste.rs/s/mtatsi/unix_shell_programming_next_50_years#c_p4ojir https://lobste.rs/s/mtatsi/unix_shell_programming_next_50_ye...
- joeyh 5y agoLooks like that ioctl needs a kernel patch.
- stuaxo 5y agoThis would be the way to go in the end. First thing is to get typed used widely. I wonder if adding support to some of the newer pagers like batcat would be a place to start ? To get wider adoption it could be worth taking an approach like egmontkob did with ANSI hyperlinks in terminal emulators: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3c...