How to force mysql.exe to run in "interactive" mode?
I'd like to get emacs sql-mysql mode working in windows xp. I'm able to enter sql-mysql mode and connect to mysql database successfully. The problem is that the SQL buffer doesn't show the "mysql>" prompt. In other words, it's not interacting with mysql.exe.
I think it's because the mysql.exe program is going into "non-interactive" mode when it's started behind the scenes by emacs.
None of the mysql options seem to be of any help.
Any ideas about how to fix this? I can see this being a problem for emacs comint mode interacting with other command line utilities in windows as well, so maybe the开发者_如何学运维re's a os level solution?
The problem is that emacs' builtin terminal uses pipes to talk to the client process. Mysql.exe is a native Windows programs, hence isatty() actually checks whether the file descriptor/handle in question is a console. That fails on pipes, hence mysql enters batch mode. I can't see a way to force interactive mode either. Shame, as it would presumably be trivial to implement.
Running it in xterm or other terminal based on Cygwin ptys will show the same issue, because Cygwin's pty emulation is based on Windows pipes.
There is actually no way if you don't run it from a (pseudo)terminal. It checks file descriptors 0 1 by isatty
and it sets batch mode if at least one of them is not a terminal. On the other side you can force batch mode.
Anyway this makes quite sense, because readline which is used for prompting needs a terminal to work reasonably. So the proper way to fix this is to run it in a pseudoterminal.
精彩评论