> This is where my mental model had been backwards. Your keystrokes never go “to stdin.” They go to the terminal, and fd 0 is just a descriptor that usually happens to point there. When the shell pointed fd 0 at a pipe instead, the keyboard did not go anywhere; the process only lost its usual pointer to it. Opening /dev/tty makes a new one. This is what less is doing when you press j: the file arrives on stdin, and your keystrokes come from the terminal.
Oddly enough, I asked ChatGPT about the same thing probably about a month ago. I understood well enough at the time, but I like this explanation better.
Something else I've learned about using computers is that it's possible to have blind spots for pretty much arbitrarily long.
zahlman•17m ago
Oddly enough, I asked ChatGPT about the same thing probably about a month ago. I understood well enough at the time, but I like this explanation better.
Something else I've learned about using computers is that it's possible to have blind spots for pretty much arbitrarily long.