News for hackers. Stuff that matters.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by mcny on Tuesday October 24, 2017 @07:02AM (#15540691)
My professor likes to tell this story about keyboard buffers that I never quite understood. Basically, in this old time terminal setup he would start typing the password before the prompt showed up or something and when it did, it would just sail through. Sort of like how I can apt upgrade while apt update is still running but fancier and a couple of decades before...
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by colejohnson66 on Tuesday October 24, 2017 @08:13AM (#15540969)
The computers at my old job working as a cashier did that. It made working with produce so much faster because as soon as I heard the beep, I could move on to the next item, even if the screen hasn’t updated yet.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by vanderZwan on Tuesday October 24, 2017 @07:31AM (#15540806)
That "old time" hurts a bit.. I haven't tried this recently, but I distinctly remember doing this in the early versions of Ubuntu.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by whatever_dude on Tuesday October 24, 2017 @08:34AM (#15541077)
That's what happens when you read from a keyboard buffer. Since the buffer is not being read (and not cleared) until a prompt is in the screen, you can type whether you want and it'll get dumped and processed whenever needed. Not that long ago really, that's how it worked in DOS and most other terminals.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by kijin on Tuesday October 24, 2017 @09:58AM (#15541524)
It still works. I can ssh into a machine and start typing commands before the shell prompt appears. The commands will appear in the terminal once the connection is established and the shell is ready.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by chasd00 on Tuesday October 24, 2017 @12:51PM (#15543011)
Isn't the keyboard buffer a part of the physical keyboard circuitry and interface? Hitting enter triggers an IRQ to flush the buffer, so if the CPU is too busy to handle the IRQ then things queue up until the CPU can get around to handling it. If that's the case, for this "feature" not to work would require a very low level architectural change to keyboards. (it's been many years since i've thought about this though)
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by singingboyo on Tuesday October 24, 2017 @03:27PM (#15544483)
Keyboard buffers are decidedly not on the physical keyboard. The keyboard might have a very small one, but the IRQ is triggered on every input.

The buffer in question is, for a tty, a driver-level buffer that holds on to the data until something reads it. If a command doesn't read it (which things like apt-get update don't) then it'll get read as the next command.

Of course, most terminals these days are ptys accessed via emulators, so the buffer is actually part of the emulator, but the same idea applies.

Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by chasd00 on Tuesday October 24, 2017 @03:42PM (#15544591)
ah, the more you know :) I would have been shocked if i remembered all that correctly
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by exikyut on Wednesday October 25, 2017 @09:25AM (#15549869)
For some reason my brain still finds it important to remember that the BIOS keyboard buffer is 15 bytes by default, but that you could load tiny little devices drivers in CONFIG.SYS in MS-DOS to make it a whole 31 bytes.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by jdmichal on Tuesday October 24, 2017 @07:15AM (#15540742)
You can still do this in at least some shells. PowerShell buffers input if the running program doesn't capture it. If I have a build and execute commands in the history, I can hit up-up-enter twice in a row to start the build and queue the execution command.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by dep_b on Tuesday October 24, 2017 @07:30AM (#15540802)
I remember people doing that on an AS/400 ramming keystrokes for 5 seconds and then waiting 15 seconds for the system to arrive in the right screen, sometimes even already filling the fields from muscle memory. The first five lines of address data were already entered before the screen loaded.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by coleca on Tuesday October 24, 2017 @05:03PM (#15545234)
When I was in high school I had a job after school where they still had a PDP/11 w/real DEC VT-100 terminals. The kid next to me used to do data entry and would get far ahead of the input screen. Except when he made a mistake, and he often did, it would beep. But because he was so far ahead when he made a mistake it would beep for 2 minutes straight. Every time. Max-volume.

Soo.. When he left his desk, I went in and hit SHIFT-SETUP, turned the audible BEL off in the VT-100 setup menu and enjoyed the silence.

When I came back in the office the next day, there was a technician from Digital with the terminal in what looked like 100 pieces on the desk trying to "fix" it. He was pretty upset when he realized it wasn't the speaker and the setting was just turned off (why he didn't check that first, I'll never know). Needless to say as a teenager, I kept quiet about the whole thing.. until now..

Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by exikyut on Wednesday October 25, 2017 @09:24AM (#15549857)
Oh wow. That is awesome.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by darylfritz on Thursday October 26, 2017 @01:56PM (#15561355)
> Sort of like how I can apt upgrade while apt update is still running but fancier

You can link two commands together with the "AND IF" operator

    sudo apt update && sudo apt upgrade
Furthermore, you also have `||` which is the logical or, and also `;` which is just a separator which doesn't care what happend to the command before.
Re:Try quickly typing 1+ 2 + 3 into the iOS 11 Calculator by jasonkostempski on Tuesday October 24, 2017 @09:30AM (#15541353)
I see that buffer effect all the time still.