How might text be selected while typing the login password on my Mac?

When I wake up my Mac I am presented with the login screen. I begin typing my password in the empty password text box.

After typing the first few characters, the password text becomes highlighted (selected) somehow thereby causing the next character I type to delete those selected characters.

For example, say my password is "password123"

  1. I press power and my Mac wakes up I type "passw"
  2. The password text becomes selected somehow
  3. I finish typing "ord123" and hit enter
  4. The password is incorrect since I am left with "ord123" in the password input box

Why is this and/or how can I prevent this from happening?


Solution 1:

This problem come from the order in which 2 important operations are scheduled to read a sensitive piece of information which is a password:

  1. lock exclusive access to the keyboard
  2. read characters typed at the keyboard

Apparently these 2 operations are scheduled the wrong way round:

  1. read characters typed at the keyboard
  2. lock exclusive access to the keyboard

The part of the kernel in charge of reading the keyboard is waken up before locking the keyboard. This is fully understandable when you want to be able to wake the system on any keyboard entry. But in such a case, a mechanism should clearly indicate to the user when the keyboard is safe to type a serious password and not wake up noise.

This wrong scheduling was apparently a small problem and not noticed by many users since the 2 operations are anyway scheduled in a small window of events (it's a question of one or 2 seconds here).

This small window of time to schedule these 2 operations is larger if you are just waking up your disk, or if your disk isn't fast enough for your fingers, or if you have too fast fingers. This is the reason why some people thought that this problem was created by hard disk drive (HDD) and suppressed by solid state drive (SSD). In fact the problem isn't suppressed by an SSD, it is just more difficult to exhibit. You should consider this as a fundamental bug in password reading which is hidden when using a fast enough disk or slow motion fingers.

Solution 2:

I know the behaviour you describe. In my case, I wake up my Mac by pressing a key and I just wait for a few secs before entering the password. The key I pressed to wake up my Mac and if I press any others in that first couple of seconds (I am often impatient to get my computer to wake up!) will get selected as you describe.

I think this is intentional behaviour by Apple, that any character typed before the password field is displayed and working is not treated as part of the password to be entered & so are deleted. The behaviour though is not a good user experience. I think a better experience should be that the characters typed before the text field is ready should not be added to the text field when it is ready, thus making it clear that characters entered before the text field is ready are ignored. The adding them & then selecting & deleting behaviour is just odd.

My answer I suppose is this. After waking your computer, just wait a couple of secs before entering your password. I've just learnt to do that without thinking about it because it works. But your right & if you have the enthusiasm report it as a bug to Apple.

Solution 3:

Does your Mac have a SSD (Solid State Drive) or Flash Storage?

I have a Macbook Pro that had this problem, and the only way to truly fix the issue was to upgrade it to a SSD. Solid State Drives resume from sleep faster than a hard disk drive, and hard disk drives will always lag a little when resumed from sleep. One thing to try to make it slightly faster would be to open up Disk Utility, select the name of your drive (Macintosh HD most likely), and select each of the buttons (please wait for each to finish and then click the next one):

  1. Verify Disk
  2. Repair Disk
  3. Verify Disk Permissions
  4. Repair Disk Permissions

Once you do that, restart your computer and see if it helps to decrease your resume times.