Get the latest tech news
"Rules" that terminal programs follow
"Rules" that terminal programs follow
As an example of how this works in an interactive program: here’s the code in prompt-toolkit(the library that iPython uses for handling input) that aborts a search when you press Ctrl-C. I actually thought that this one was a “Law of Terminal Physics” until very recently because I’ve basically never seen it broken, but you can see that it’s just something that each individual input library has to implement in the links above. Both of those programs will also format their output differently when writing to the terminal: ls will organize files into columns, and ripgrep will group matches with headings.
Or read this on Hacker News