Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs / CVS / OpenSSH: preventing password popup

I'm using GNU Emacs on my Ubuntu netbook in fullscreen mode. When I edit files that are under version control and hit C-x v v to commit the latest changes, an OpenSSH popup window will open and ask me for my password for the server on which my repository lives.

Unfortunately, because of the fullscreen mode, the popup window will not come up front and I cannot enter my password. But it's still somehow modal, so I also can't go back to emacs and, say, leave fullscreen mode either (or do anything else, like C-g). I'm basically trapped.

As an emacs user, I find the idea of popup windows disgusting anyway ;-) so ideally, I'd like to be asked for the ssh password in the minibuffer. How can I tweak my setup to make that happen? (I prefer to type in my password every time instead of storing a keypair in ~/.ssh/).

like image 237
Thomas Avatar asked Jul 14 '10 11:07

Thomas


3 Answers

You could use ssh-agent before launching emacs (or in another shell).

like image 113
Dirk Eddelbuettel Avatar answered Oct 21 '22 05:10

Dirk Eddelbuettel


I'm speculating here, as I neither use CVS or vc within Emacs, however I presume that Emacs is shelling out to the appropriate program to perform the commit, and the password prompt is something entirely external to Emacs. So I suspect what you want to do is firstly find out which options are needed to do a GUI-less commit from your shell without Emacs, and then modify vc-checkin-switches (or define vc-cvs-checkin-switches) in Emacs to match (see defun vc-switches).

like image 43
phils Avatar answered Oct 21 '22 05:10

phils


It's probably the ssh-askpass program kicking in, which I think looks at the DISPLAY environment variable to decide how to request the password. If set, it pops up a graphical window, and if not, it asks the TTY.

If the vcs subsystem detects when passwords are requested from the user (which is likely), then it's possible that you can unset $DISPLAY for subprocesses:

(setenv "DISPLAY" nil)

This might have other negative side-effects, though, so also check out "man ssh-askpass" in case something there might help.

(Disclaimer: I personally use a solution based on ssh-agent, which I strongly recommend.)

like image 40
sanityinc Avatar answered Oct 21 '22 05:10

sanityinc