EmbeddingGemma 2: an open, lightweight multimodal embedding model
deepmind.google·6d ago

TL;DR
A method was discovered to allow interactive programs to accept keyboard input even when reading from a piped input. This was achieved by cleverly managing file descriptors in a single binary piped multiple times.
✦ Why It Matters
Explore using multiple pipes in your interactive applications to enhance user input capabilities.
Key Takeaways
How It Works
Each process in the pipeline checks its stdin and stdout to determine its role. The first process reads from the terminal, while subsequent processes read from the previous stage's pipe.
When a downstream process needs user input, it opens /dev/tty, creating a new file descriptor that points to the terminal, allowing it to read keystrokes directly.
Related