help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[h-e-w] issue with emacs and msvcrt getch(?)


From: E. S.
Subject: [h-e-w] issue with emacs and msvcrt getch(?)
Date: Tue, 3 May 2011 19:54:06 -0400

I'm on Windows XP SP3 (tried different computers running the same OS, both 32 and 64 bit - same results every time). My emacs is the windows binary distro; it's happening on v23.2.1 here at home but I upgraded to 23.3 at work and I still have issues there.

A few months ago I tried running the db2 CLP from within emacs but it kept hanging at the password prompt. I noticed similar behavior if, in python, I used getpass.getpass(). That function works fine until I get to msvcrt.getch(), which hangs in the python comint buffer (using python-mode.el if anybody's interested). The getpass function loops like this:

while 1:
    c = msvcrt.getch()
    if c == '\r' or c == '\n':
        break
    ...
    else:
        pw = pw + c

If I modify slightly and check just msvcrt.kbhit() in a loop to see if any keystroke ever gets noticed, that function never returns true; I thought that maybe it was just a getch thing. I can only guess that the db2 CLP is also trying to make a low-level call to the windows api, but it's not working correctly from within emacs (outside of emacs everything works fine).

To round things out some, I /am/ able to enter passwords in certain situations - when sending email using the Message package for instance I am prompted for a password in the minibuffer. Also, while playing with all of this I remember seeing something about a regexp to match comint output that looks like a password prompt so that emacs can take over the input in the minibuffer. Whatever regexp that was looked like it should've matched at least python's "Password:" prompt, but still I had this problem.

Can anybody confirm similar behavior? Has anybody solved this? Does anybody know where I could even begin to look to find what may need patching?

Thanks


reply via email to

[Prev in Thread] Current Thread [Next in Thread]