12 ms·
ASCII table and history – Or, why does Ctrl+i insert a Tab in my terminal?
- rkta 4y ago> Image 3, Ken Thompson working on the PDP-11 using a Teletype (model 33?). What always struck be about this image is the atrocious ergonomics of … everything. The keyboard, the chair, everything about the posture: it’s all terrible. Inventing Unix almost seems easy compared to dealing with that! I've seen this photo a hundred times and never thought about that. I wonder when ergonomics started being a thing when designing computer workplaces.
- enriquto 4y agoBrian, on the other hand, has an excellent, powerful posture: https://www.youtube.com/watch?v=tc4ROCJYbm0 https://www.youtube.com/watch?v=tc4ROCJYbm0 (see from 4'10). Feet on desk, keyboard on lap, reclined seat, talking about unix filters.
- rkta 4y agoIf you are building an OS and someone is making a movie about it you gonna make sure you look cool. I'm not convinced this is how he worked every day.
- gavindean90 4y agoEveryday? No, sometimes? Probably.
- sn41 4y agoI have always noticed it, since I get a stiff back often. Office furniture has improved by a great deal.
- amelius 4y agoBack then you had to pound on the keys, which made you develop strong hands, like a piano player.
- 082349872349872 4y agoI sometimes wonder if having learned to touch type on mechanicals* has protected me from RSI? * carriage return used to be huge honking lever
- karmakaze 4y agoI'm imagining it on the right side, but it must have been on the left to return the carriage to where the hammers can hit the page at the left margin.
- 082349872349872 4y ago... or you're imagining an RTL typewriter: https://cdn.shopify.com/s/files/1/2384/6833/products/DSC_0264_f6eeec7f-af1d-4749-8fbd-c80c5252301d_1512x.JPG?v=1550926003 https://cdn.shopify.com/s/files/1/2384/6833/products/DSC_026...
- hackermatic 4y agoIt depends on the typewriter. The Remington 12 has the carriage return lever on the right side: https://typewriterdatabase.com/Remington.12.42.bmys https://typewriterdatabase.com/Remington.12.42.bmys
- hackermatic 4y agoIf anything, speaking as someone who has RSI and collects typewriters, you've been spared despite them. The traditional typewriter keyboard arrangement with rows increasing in vertical height as they move away from you is precisely the opposite of what you want, ergonomically. It's strange to me that so many computer keyboards still have fold-out tabs at the back to emulate this. I even saw an old PS/2 keyboard with terraced rows just like a typewriter! But habit is a powerful thing. Pardon the tangent, but we're using an 1870s design whose main constraints were making room for key levers to travel up and down (which is also why we have staggered keys instead of an ortholinear grid). The funny thing is that there were decades more of alternative typewriter keyboard designs (look up the Hammond 1 for an example), but the first commercially successful typewriter, the Sholes and Glidden, is the one that won out in the end.
- gjvc 4y agoI wonder when ergonomics started being a thing when designing computer workplaces. Look at what Douglas Englebart used for the "mother of all demos"
- kjs3 4y agoRemember that the Teletypes were old school telco, mostly output devices, repurposed for computers. They were constructed first to be extremely durable, and then somewhere way down the list of requirements, easy on the users. The typical use case wasn't to pound on them all day long (tho some did), and you can tell. Seem to recall that ergonomics really took off in the 80s and 90s, as people started suing for things like RSI which made companies start to care. I remember that was when everyone seemed to be swapping out for adjustable chairs and bolting keyboard trays on desks and having everyone take ergo training.
- b112 4y agoThey were constructed first to be extremely durable, and then somewhere way down the list of requirements, easy on the users. I watched this documentary, about a huge computer, just massive, huge, and a guy called Forbin. It showed governement spending out of control, and the ensuing disaster, although I was a bit high at the time, and the plot eluded me. Anyhow, the terminals seemed much nicer than you describe, so maybe it was down to the employer?
- wombatpm 4y agoYou only needed to enter a few commands to process your stack of punch cards so ergonomics didn’t matter
- thaeli 4y agoErgonomics still mattered for making the punch cards in the first place - and the machines for that used similar keyboards.
- rep_lodsb 4y ago"Colossus: The Forbin Project"? Not a documentary though. Military computer joins up with its Soviet counterpart and takes over the world. There may have been some teletypes, but the more memorable output device was the big scrolling line of text. RESTORE COMMUNICATION -- FROM COLOSSUS -- TO GUARDIAN -- OR ACTION WILL BE TAKEN
- jhoechtl 4y agoLink to an image?
- rkta 4y agoIt's image 3 in the linked article.
- reaperducer 4y agoI wonder when ergonomics started being a thing when designing computer workplaces. IME, it was the early to mid 90's. Suddenly there were consultants for everything, and office/ergonomics consultants started popping up. I suspect it's related to the shift to the widespread use of computers in the office. Carpal tunnel syndrome went from obscure to an "everyone knows someone with it" kind of thing. I knew someone who eventually had to wear big arm-length metal braces while using a VT-52. The bean counters figured out that if they made small-money adjustments to their workplaces, they could save big money on health insurance premiums.
- deleted 4y ago[deleted]
- saurik 4y ago> Sending Control with a character from the 2nd column is useless. Control clears the 7th bit, but this is already 0, so Control+# will just send “#”. With the curious exception of Ctrl-?, which turns ON the 7th bit and results in DEL.
- tyingq 4y ago>so Control+# will just send “#” You can get around this with Ctrl-v Like typing, at a shell prompt: echo "<ctrl-v><ctrl-#>"
- mprovost 4y agoBut that still doesn't result in a control character. In my terminal (testing with cat -v) I just get a beep (and it's not a BEL character!). Because the 7th bit of 35 ('#') is already 0 there's nothing to convert it into.
- tyingq 4y agoInteresting, maybe terminal dependent, because it seems to work for me. Piping it to hd shows 7f coming out for <ctrl-?> and 1b for <ctrl-#>. And it works for other things, like: echo "<ctrl-v><esc>c" clears my screen. (where <ctrl-key> means pressing <ctrl>+key, <esc> means pressing the escape key, etc)
- mprovost 4y agoFor my Rust book I've just been diving into the old BSD 4.4 source code for cat which converts control characters into printable ASCII with the -v flag and it handles DEL as a special case: putchar(ch == '\177' ? '?' : ch | 0100). But if you XOR the character with 0100 (64) it always clears the 7th bit, which results in '?' for DEL. Interestingly, peeking at the GNU coreutils code it also handles DEL as a special case and just prints "^?".
- soneil 4y agoDEL's an exception because it had to be all ones. The idea is you can turn any character into a delete character by punching out the rest of the row on a punchcard. Were it any other character, you'd potentially have holes you needed to un-punch.
- 082349872349872 4y agofor any who wish to go deeper: https://archive.ph/gsVX7 https://archive.ph/gsVX7
- EvanAnderson 4y agoA couple of other nice links: Four Column ASCII: https://garbagecollected.org/2017/01/31/four-column-ascii/ https://garbagecollected.org/2017/01/31/four-column-ascii/ (and associated HN discussion: https://news.ycombinator.com/item?id=13539552 https://news.ycombinator.com/item?id=13539552) The Evolution of Character Codes, 1875-1968: https://archive.org/details/enf-ascii https://archive.org/details/enf-ascii (and associated Github repo: https://github.com/e-n-f/ascii https://github.com/e-n-f/ascii) Bob Bemer, consider the "Father of ASCII", died in 2004 and his website has gone offline. The Wayback Machine has archives. It looks like the last one that was his website (before the current squatter) was: https://web.archive.org/web/20180511201723/http://bobbemer.com/ https://web.archive.org/web/20180511201723/http://bobbemer.c...
- kps 4y ago> There is no way to see if the user pressed only Control or Shift, because from a terminal’s perspective all they do is modify a bit for the typed character. Modern terminal emulators can do this using the xterm modifyOtherKeys protocol, which sends escape sequences for such combinations.
- aumerle 4y agomodifyOtherKeys should not be used. https://sw.kovidgoyal.net/kitty/keyboard-protocol/ https://sw.kovidgoyal.net/kitty/keyboard-protocol/ is far more comprehensive.
- kps 4y agoDisagree. As with the graphics discussion the other day, Kitty seems to have a NIH problem. At best, it's unnecessary extra work for other projects to support another flavour; at worst, it leads to fragmentation. Meta: I'm not among the downvoters; on the contrary I aim to upvote any on-topic reply (although I don't always get back to a thread, and anyway I suspect all my votes are shadow-ignored).
- continuational 4y agoBut is there any way to get modern terminal keyboard support without it?
- db48x 4y agoI get why Kovid (the author of Kitty) wants to invent new protocols that improve on the existing ones (Kitty’s image protocol is quite a bit more efficient than Sixels, for example), I just don’t understand why he won’t implement both the old and the new. Supporting both Sixels and his own image protocol at the same time would be almost trivial. Of course only one keyboard protocol can be active at a time, but surely the user should be able to choose between them so that they can use software which already supports XTerm’s escape sequences.
- 4y ago
- wendyshu 4y agoThese "X, or: Y" titles are becoming an annoying cliche.
- mprovost 4y agoThe earliest title with this format that I know of is "Is Sex Necessary? Or, Why You Feel the Way You Do" by James Thurber and EB White from 1929. But, that book was a parody so presumably copied the form of its title from contemporary books.
- shadowofneptune 4y agoThe most famous book title I know with that format is Frankenstein, or The Modern Prometheus. It's so old a style that I find it funmy that it could be seen as a fad.
- mprovost 4y agoTrue, but I was matching on "or, why" not just "or".
- datpiff 4y agoFrankenstein; or, The Modern Prometheus (1818)
- irishsultan 4y agoAccording to wikipedia even shakespeare parodied the style of subtitles in "Twelfth Night, or What You Will", so again much older than 1929.
- saurik 4y agoThese titles are actually forced by websites like Hacker News, as a dry and fully-descriptive title doesn't get clicked--nor should it, as it has no reason to make the reader care--and yet Hacker News has this unfortunate rule where it usually attempts to disallow what it calls "editorializing" and so the way users coming from other sites often try to submit things--using pull quotes to direct the reader to specific informative bits that make them more likely to read the article--get their title reverted (even often awkwardly after the post has received a ton of upvotes and the discussion has surrounded the submitted "title", which I feel should be a signal that--at least in some examples--the title wasn't harmful, and was merely "I wanted to link to one paragraph and not a full article", which otherwise requires "blogspam" where you write an article that summarizes the other article and calls out the paragraph, which is also disallowed for good reason, and so this website also awkwardly encourages casual plagiarism). The result is that, rather than articles getting contextually-dependent links that are customized for the community and the time (and which lead to particular discussions), you as the author have to try to come up with a single title that somehow manages to simultaneously be a reasonable title but also serves as its own pull quote (which also effectively prevents long content or manuals from getting linked at all)... it is utter madness, and that the moderators here don't seem to understand this dynamic (even in a "we realize this is bad but we are stuck with it for various reasons--which may include some that are trade offs--but are interested in looking into alternative options" way... dang, as one example, seriously seems to only defend this behavior as good, citing some form of author control despite failing to show that this isn't a problem for authors) is the main reason I wish Hacker News didn't have a from-network monopoly on this community :(.
- mprovost 4y agoWhen Apple (temporarily) got rid of a physical Esc key I (permanently) retrained myself to type ctrl-[ which is the same character (91 - 64 = 27).
- sushibowl 4y agoPeople who used vi/vim may also know this one as a way to get out of insert mode that is somewhat easier to reach. Nowadays I remap the TAB key to send ESC.
- u801e 4y agoI wonder if that remapping also allows you to use ctrl-i to get out of insert mode. If that's the case, you can switch between the two by pressing i and ctrl-i.
- mprovost 4y agoWell, the article says: "There is no way to distinguish between the Tab key and Control+i. It’s not just ‘the same’ as Tab, Control+i is Tab." So you'd be mapping Tab to Escape to get out of insert mode.
- recuter 4y agoTry mapping jk to ESC.
- kfajdsl 4y agoHow do you indent?
- enriquto 4y agoIf you :set autoindent you'll never need to indent using the tab key. Indentation happens automatically as you write code. In the very rare cases where you need to change the indentation of a line, there's == or, if that doesn't work, you can indent a line forth and back with >> and << .
- userbinator 4y ago"Because I is the 9th letter of the alphabet, and character 9 in ASCII is a tab." clear the 7th bit. I wonder how common it is to see bits numbered from 1 instead of 0, because "7th bit" to me is the top one in a byte, with weight 2^7 = 128.
- irishsultan 4y agoThe first element of an array is usually indexed by 0 (usually here means in most modern programming languages). The second element is usually indexed by 1 etc. So the eight bit in a byte is indexed by 7, but that doesn't suddenly make it the 7th bit.
- kevin_thibedeau 4y ago"0th" is not a natural use of ordinal numbering. It is safe to assume such numbers start from 1.
- bhaak 4y agoIs ASCII the best product we have coming out of a "designed by a committee" process?
- karmakaze 4y agoWould you have preferred EBCDIC?
- bhaak 4y agoHell, no. I was just wondering if there was an even better product of a design by committee. ASCII is pretty good for its time and how it was created.
- karmakaze 4y agoUnicode kept the ASCII part, so no? The only thing I found weird is the non-printable DEL 127 character being where it is.
- Beltalowda 4y agoOn punchcards having it as the highest character (with all holes punched) is the only way you can reliably do "delete" or "ignore" outside of having a special dedicated hole for it.
- kps 4y agoDEL derives from earlier teletypewriter codes, and is based on the use of paper tape. All bits set means all holes punched, so it's the only code that can eliminate any other code.
- db48x 4y agoCommon Lisp was designed by a committee, and is widely regarded as an excellent language (or at least an excellent Lisp). It even has principles that it sticks to throughout. For example, it is deliberately designed to be a multi–paradigm language, allowing the user to write programs in functional, imperative, or object–oriented styles without forcing one or the other.
- u801e 4y agoThat explains the convention of using repeated ^H in a post to show one deleting a word (typically what they really meant) and replacing it with something more acceptable. Occasionally, I saw people use a single ^W instead for that purpose.
- mortehu 4y ago^H deletes a single character, while ^W deletes a whole word in many different programs, including those that use GNU readline (e.g. bash). Similarly, ^U commonly deletes the whole line, or from the cursor to the beginning of the line. ^U is particularly useful when you think you might have mistyped a password and there are no indicators about how many characters you've typed (e.g. ssh or sudo).
- layer8 4y agoOn Usenet, it was customary to use ^L (form feed) to hide spoilers, because text-mode readers would then blank the rest of the screen until you paged past the form feed.
- db48x 4y agoYou wouldn’t believe how common it is for people using Emacs in a terminal to bump up against the limitations. Assigning a key binding to M-[ is a particularly bad idea (<https://emacs.stackexchange.com/questions/68703/m-causes-emacs-to-print-weird-possibly-escape-sequences https://emacs.stackexchange.com/questions/68703/m-causes-ema...>)!
- H4ZB7 4y agoterminal is useless garbage. i literally have PTSD from using the mouse scroll wheel while reading a man page because for the longest time there was some obscure misconfiguration or bug in my terminal or something above it: you would scroll and some random pieces of text here and there would not render. whenever i read a man page on that system, i would realize i missed an important part later on because the bug where that piece of text doesn't render was present. this isn't because graphics programming is hard, it's because the terminal is obscure error prone crap that nobody not even the most die hard hackers want to learn to configure properly (the most die hard only learn enough terminal stuff to look smarter than their peers, and stop at that) the idea of your program not doing graphics, but instead invoking and interacting with a simulated model of a teletype (a device nobody born after 1990 even knows what is) so then the graphics stack can render its behavior to screen is completely asinine, like on the "anyone who uses this in their work should be fired" level. i could never decide what's stupider, this or the C language. both were obsolete 30 years ago. yet diehard patriotic nostalgia tripping nerds who have no idea how software engineering works but just want to learn complicated things to look cool fought tooth and nail to keep this crap alive for decades. whenever someone says "the UN*X way", they really are saying, "I designed something modularily, you could have never thought of that", but what it really means are all these insane nonsense ideas that don't even begin to make sense, like: -a filesystem centric security model that doesn't even begin to address real world use cases -C -ad hoc encodings that never mattered like octal, everything being a int<my machine word size> -*sh -perl, tcl -terminal emulators -DNS -all these shitty little tools that compose horribly, like sed, where you have to pass --sandbox to make up for the fact that it indeed composes horribly -web and email, which are thoroughly embedded in UN\*X influence, and ergo, suck big time -X.509 this is why open source sucks and is barely a competitor to proprietary garbage running in your IoT device. in fact, every single vulnerability in them springs from these bad ideas. i have
- glonq 4y agoYou haven't lived until you've used ^G to abuse somebody's hearing.