Describe the bug
sudo command dose not display password prompt, so I can't input password to sudo command on gvim after v8.2.2919 ( 6a43b37 ).
To Reproduce
vim -g -c 'set shelltemp' -c ':!sudo touch /tmp/foobar' -u NONE
Expected behavior
I can input password to sudo command.
Screenshots
Environment (please complete the following information):
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
![]()
I cannot reproduce this bug despite using vim-8.2.2969 (gtk3) on xubuntu-18.04.6.
For me, vim asks for the sudo password without error.
Oops, I forget information about shell, I use zsh.
Would you please try again using the following it ?
SHELL=zsh vim -g -c 'set shelltemp' -c ':!sudo touch /tmp/foobar' -u NONE
And, I also couldn't reproduce this problem when I checked it on bash.
I think this issue is shell matter and original issue (#8314) is same (I also cannot reproduce #8314 on bash).
So, IMO v8.2.2919 should be revert.
I got it that v8.2.2919 is result of long discussion at #4738 .
I have also investigated the behaviour of other shells (dash and tcsh), so I note the results of it.
I just look this results so I think behaviour of zsh is something wrong... and I don't know why bash is both ok.
SHELL=<shell> vim -g -c 'set shelltemp' -c ':!touch /tmp/foobar &' -u NONE
| shell | vim v8.2.2918 | vim v8.2.2919 |
|---|---|---|
| zsh | not create file | create file |
| bash | create file | create file |
| dash | create file | create file |
| tcsh | create file | create file |
SHELL=<shell> vim -g -c 'set shelltemp' -c ':!sudo touch /tmp/foobar' -u NONE
| shell | vim v8.2.2918 | vim v8.2.2919 |
|---|---|---|
| zsh | can input password | can not input password |
| bash | can input password | can input password |
| dash | can input password | can not input password |
| tcsh | can input password | can not input password |
anyway, I look for another solution (eg. install askpass or alias gvim="SHELL=bash gvim")
Thank you for reading my broken English.
—
should be fixed by fff10d9
I leave this open, as there still seems to be an issue with zsh
Thank you for accepting my suggestion.
I just noticed this change and late to the party. FWIW I am seeing that this does break the :! <cmd> & pattern in the latest MacVim, but it seems to work in gVim in Ubuntu that I tested on, so I think it depends on a variety of factor (probably partially since Vim has a hack of doing signal(SIGHUP, SIG_IGN); to try to support :!xterm &).
It does seem like by making a controlling terminal when you spawn the child process, you are essentially disallowing :! <cmd> & in Vim since when it detaches it will try to kill the processes. I think it's probably ok, if we just say "use :call system('<command> &') instead.
For entering passwords without a controlling terminal, MacVim just sets the SUDO_ASKPASS and SSH_ASKPASS environmental variables to the location of script that prompts for the password in a GUI. This allows sudo to retrieve the password from the external GUI app (since otherwise it needs a proper terminal to read it from). E.g. You can do apt install ssh-askpass in Ubuntu for a simple program to do that.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()