4 ms·
This article caught me off guard, because the last one seemed to come from a place of knowledge. I thought a lot of how backspace worked was something that ever
by mrguyorama 9y ago
This article caught me off guard, because the last one seemed to come from a place of knowledge. I thought a lot of how backspace worked was something that every programmer whose ever written a terminal program has experienced at least once. We faced this during a 300 level System Programming class while implementing a simple shell. Is this not something everyone with a CS background experiences? I guess you could miss it if you never go lower than javascript, or never try to do same line reprinting ie for text based progress bars
- beefhash 9y agoI did know about \r moving the cursor back to redraw an entire line, but I never looked into ^H or other cursor manipulation characters for some reason. Progress bars just kind of never came up in the things I do (which is mostly daemons and text manipulation), so I haven't had to.
- dboreham 9y agoThe times they are a changin'
- mrguyorama 9y agoYou say that, but I'm very young, and didn't start writing code until after Windows Vista was released, let alone taking college classes. I guess I'm having a hard time understanding those who don't take an intrinsic interest into the lower level stuff in computers
- delecti 9y agoAll fields are abstractions on top of abstractions. Do you think every coder learns quantum physics? Certainly not, but it's vitally important for all modern computers. At some point everyone must decide either that they've cleared away enough abstractions for their purposes, or that their purpose is clearing away those abstractions.
- zokier 9y agoI'd point out the crucial detail that terminal handling arcana is not really "low level" thing; from abstraction point of view it sits pretty much on the same layer as DOM details or whatnot. You could know everything from low-level kernel innards to latest front-end framework fluff and never encounter terminal handling in any way. Text terminals are ultimately an evolutionary dead end (or at least so it seems currently), almost all modern stuff diverges from it instead of building on it.
- katastic 9y agoThose who don't learn from the past, are doomed to reimplement it.
- bitwize 9y agoA lot of people used to know this stuff, but today most developers were weaned on Macs and Windows boxen. They not only don't understand how terminals work, they frequently call for the tty interface to be put out to pasture and replaced with an Electron app that communicates with the shell via separate data and control streams MUXed over HTTP/2. The phenomenon of once common tribal knowledge becoming forgotten lore is so extensive that ESR put together a document compiling such knowledge for future generations called Things Every Hacker Once Knew: http://www.catb.org/esr/faqs/things-every-hacker-once-knew/ http://www.catb.org/esr/faqs/things-every-hacker-once-knew/
- nxc18 9y agoDon’t know why you’re being downvoted. Nowadays you’re not going to understand how a terminal works unless you’re doing some very specialized work or you really want to understand that. Young developers I’ve met are typically stuck on the treadmill learning things that change a lot (typically web).
- rhinoceraptor 9y agoWhen I wrote a shell in school, I used getline(3). Why muck around with the horror show of terminal emulators? The point of writing a shell is to learn how file descriptors work, redirection, pipes, fork(), exec(), etc.