Skip to content
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

In Neovim, returns 'There was an error writing the file! sudo: no tty present and no askpass program specified' #48

Closed
R3load opened this issue Apr 12, 2018 · 8 comments

Comments

@R3load
Copy link

R3load commented Apr 12, 2018

A simple :SudoWrite throws There was an error writing the file! sudo: no tty present and no askpass program specified in Neovim.
Doesn't occur in vanilla Vim.

:!sudo -v and :!sh -ic 'sudo -v' return the same sudo error.

See also:
https://github.com/neovim/neovim/wiki/FAQ#-and-system-do-weird-things-with-interactive-processes
neovim/neovim#1496

@chrisbra
Copy link
Owner

yeah, it is a known problem that neovim broke compatibility here. Since I am not using Neovim, I am not able to fix it. That should be fixed by the neovim developers anyhow, since they broke it. Sorry.

@aemonge
Copy link

aemonge commented Sep 20, 2018

So I stopped using this plugin for a while now because of this isn't working on neovim.
I disagree completely with you not wanting to support neovim, since it's the future of vim. It's sad that you don't want to support nor even work around the issue.

I found a "workaround" to be able to use the feature which I hope it changes your mind about neovim and helps anyone that wants this feature.

Install a graphical ask_pass and use it, in arch linux pacman -S x11-ssh-askpass:
let g:sudo_askpass='/usr/lib/openssh/gnome-ssh-askpass'

Hope this helps and motivates :)

@chrisbra
Copy link
Owner

I completely disagree regarding the future of Vim. But perhaps I am biased, because I have been active in the Vim community for over 10 years, using Vim for almost 20 years and I have contributed various feature enhancements and bug fixes over the year.

Regarding the neovim breakage, I did not say I am not wanting to fix the issue. But as I don't use neovim, I have no clue how to work around it or even fix it properly. If anybody knows, let me know (or even better, open up a PR).

For the beginning, you could create a PR updating the documentation on how to make SudoEdit work with neovim ;)

@aemonge
Copy link

aemonge commented Sep 20, 2018

:)

Awesome !!! here it is: #49

@aemonge
Copy link

aemonge commented Sep 20, 2018

And also..... since you have twice the experience I have in vim ( you 20y me 10y) I'm a bit surprised you don't think neovim is the future. I would love to understand your point of view, to enrich mine.

@chrisbra
Copy link
Owner

Awesome !!! here it is: #49

thanks, merged.

And also..... since you have twice the experience I have in vim ( you 20y me 10y) I'm a bit surprised you don't think neovim is the future. I would love to understand your point of view, to enrich mine.

This might be a bit off topic, but let me explain. First of all, I did not find it very helpful to fork a mature, healthy OpenSource project without trying to get the patches merged into Vim itself. The initiator of Neovim basically suddenly appeared on the main vim-dev mailinglist throwing over it's patches, that did not even run on all supported systems and there was no test for it. Admittedly there was not much feedback, although I tried to give some.

In addition, Bram is usually busy maintaining Vim itself and did not give feedback. But that is the way he works. He put it into his todo list (:h todo) and looks at it whenever he comes to it and he usually at least acknowledges submissions. I also had to learn this over time.

So out of frustration it seems the fork appeared, claiming Vim is no open source project and does not listen to the community, which is totally wrong. Over the past years, several people have contributed to Vim, bugs have been fixed (often really quick) and enhancements made. So those attacks were not really helpful and only split the community into pro/against neovim users. I personally think, time would have been better spent on trying to get features directly into Vim instead of creating a new project and having to refactor the old codebase plus trying to follow the patches from Vim. I have seen too many forks die because the initiators lost interest (as apparently happened with the main initiator of Neovim). However, I must confess, Neovim is doing pretty good in this regard and justin is doing a pretty good job on managing Neovim.

Then some of the design decisions of the early Neovim were really questionable, I mean, why on earth would I remove the clipboard feature just so that you now have to add a new clipboard provider? Or removing the builtin encryption code. That leaves me as a user without the possibility to read my old files. Now you could say, that is the task of a plugin and in principle I agree. So I could use the well known gnupg.vim, except for it does not work because for the same issue this issue here has been created. And that one is even maintained by a neovim dev. There were a couple of other design decisions that I personally do not like, like removing support for other systems or the gui.

From my side of View, it looks like Neovim is trying to add a lot of new features (some of which to me look like bloat and not really useful) that are requested by the community while trying to refactor the source. That leads to slightly different APIs (as could be seen by the async feature) and trying to maintain compatibility to Vim will most likely become more and more a headache.

I have nothing personally against Neovim or any of its developers. I even regularly contribute to their issue tracker and comment here and there. But my system is Vim. It does all what I need, and whenever I encounter a bug I submit a patch to Vim and sometimes it even gets merged (like it recently happened with the builtin diff support, that makes diff work really well now in Vim) and then eventually the Neovim project will receive this contribution.

BTW: there is a nice Video, in which Bram talks about the development of Vim for the past 20 years or so. It is highly recommended and you can see that he really worked with the community to maintain Vi all those years. Being able to maintain such a big software project over all those years without loosing interest in it, shows a huge passion. That is something that Neovim still has to prove.

@aemonge
Copy link

aemonge commented Sep 21, 2018

Wow, you left me speechless. The only one thing that I know to say, is " Thank you " .... You have enlighten me a bit, and now I'm super curious and I'm going to go deeper into this rabbit hole. I'll learn more from both vim and neovim.

I'll share this link to a few friends of mine (quite friends, hehehe) if you don't mind.

Anyways, thanks a again !

@TamaMcGlinn
Copy link
Contributor

I ran into this problem with every new computer install. This is my fix:

Install ssh-askpass: sudo apt install ssh-askpass
add this to ~/.bashrc export SUDO_ASKPASS=/usr/bin/ssh-askpass

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

4 participants