Skip to content

Can't type password on numpad #1143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tambourine-man opened this issue Dec 16, 2020 · 8 comments
Open

Can't type password on numpad #1143

tambourine-man opened this issue Dec 16, 2020 · 8 comments

Comments

@tambourine-man
Copy link

Describe the bug
Can't use the numeric keypad to type passwords anymore. Worked fine in previous versions.
Terminal version (running /Applications/MacVim.app/Contents/Resources/vim) works fine.

To Reproduce
Use the famous sudo trick:
:w !sudo tee % >/dev/null
Type numbers or use the “enter” key on the numpad

Expected behavior
Keypresses should work.

Environment (please complete the following information):

  • MacVim 8.2.2127
  • Mojave 10.14.6 (18G103)
@ychin
Copy link
Member

ychin commented Dec 16, 2020

So you are using the GUI version right? How does it not work exactly? Does it still pop up the dialog box and you just couldn't type? Or you could type but it doesn't match the password?

@tambourine-man
Copy link
Author

tambourine-man commented Dec 16, 2020

So you are using the GUI version right?

Yes I am.

How does it not work exactly? Does it still pop up the dialog box and you just couldn't type? Or you could type but it doesn't match the password?

The dialog appears but no input is passed through it. Please check the video attached.

NumpadBug

@ychin
Copy link
Member

ychin commented Dec 27, 2020

I could reproduce this if I do :!zsh and use the numpad. You will notice that it doesn't work properly.

I'm still a little confused here though. By default MacVim is supposed to pop up a dialog box to ask for password. I think you may have misunderstood what I said about dialog box. I mean a UI dialog box, not an in-place stdin "Password:" prompt, and sudo should have forced you to use the -S flag in order to allow password entry if the dialog box is not working.

Can you show me what :echo $SUDO_ASKPASS shows when you are in MacVim? That should have been set, which allows you to use the dialog box instead of the in-place password entry which doesn't work very well.

@ychin
Copy link
Member

ychin commented Dec 27, 2020

Alternatively it could be a security settings issues. If $SUDO_ASKPASS is correctly set, then maybe go to System Preferences -> Security & Privacy -> Automation, and go to MacVim.app. See if it's allowed to control "MacVim.app"

@ychin
Copy link
Member

ychin commented Dec 27, 2020

Also, if you could let me know what set guioptions? shows as well that would be useful. I'm curious if you had set guioptions+=! on or not.

@tambourine-man
Copy link
Author

Hi, thanks for the reply.

By default MacVim is supposed to pop up a dialog box to ask for password

Is that new behavior? It never happened to me before.

Can you show me what :echo $SUDO_ASKPASS shows when you are in MacVim?

Sure, here you go. Nothing happens.
(GitHub now accepts video, yay, no more gifs. It's like we're in the 21st century or something).

Screen.Recording.2020-12-27.at.20.27.25.mp4

then maybe go to System Preferences -> Security & Privacy -> Automation, and go to MacVim.app. See if it's allowed to control "MacVim.app"

It shows “Finder” underneath it. I tried adding it to Full Disk Access as well, but no dice.
Screen Shot 2020-12-27 at 20 34 36

Also, if you could let me know what set guioptions?

Sure: guioptions=egmrL

@tambourine-man
Copy link
Author

Just tried on a Guest Account with no .vimrc, same issue.

@ychin
Copy link
Member

ychin commented Dec 28, 2020

Is that new behavior? It never happened to me before.

That has always been the case before. The way it works is that MacVim sets up an environmental variable called $SUDO_ASKPASS that specifies a program that can show a password dialog prompt for you to enter. That said, seems like you are on 10.14 Mojave and I played around in a VM and seems like by default sudo doesn't use it, and you have to use sudo -A instead to force it to use the askpass dialog box (while on 10.15 Catalina and 11.0 Big Sur seems like it would do it automatically).

What was the behavior for you before? The fact that you see "Finder" in the security panel suggests you have seen the dialog box before. Was the previous behavior showing a GUI dialog box? Or was it the inline password entry that you see now but it accepted numpad (I would be surprised if that's the case though)?

What did change was in r166, where #1091 changed the target of the askpass script to target MacVim.app itself, instead of Finder, so that could matter. There may be differences in how Vim sets up the tty too but I'm not sure.


If you want a quick fix, I suggest either using sudo -A to get the dialog box to show up, or add set guioptions+=! to your vimrc which makes all :! calls go through the Vim terminal which is more robust than the old way.

I think updating to a newer macOS version may fix it too :). I think Catalina started to default to zsh which may matter as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants