How to make mysql.exe work in interactive mode?

I would like to get sql-mysql emacs mode working in windows xp. I can enter sql-mysql mode and successfully connect to mysql database. The problem is that the SQL buffer does not display the mysql> prompt. In other words, it does not interact with mysql.exe.

I think because the mysql.exe program goes into "non-interactive" mode when it runs behind the scenes of emacs.

None of the mysql options seem to help.

Any ideas on how to fix this? I see that this is a problem for emacs comint mode interacting with other command line utilities in windows, so maybe there is an os level solution?

+4
source share
2 answers

The problem is that the emacs built-in terminal uses channels to interact with the client process. Mysql.exe is a native program for Windows, so isatty () actually checks if the file descriptor / descriptor is the console in question. This does not work on pipes, so mysql enters batch mode. I also do not see a way to force interactive mode. Shame, as it would supposedly be trivial to implement.

Running it in xterm or another terminal based on Cygwin ptys will show the same problem, because Cygwin pty emulation is based on Windows tubes.

+3
source

There really is no way unless you run it from a (pseudo) terminal. It checks the file descriptors 0 1 for isatty and sets batch mode if at least one of them is not a terminal. On the other hand, you can force batch mode.

In any case, this makes sense, because readline, which is used for the request, requires that the terminal work with a sufficient degree of reliability. Therefore, the correct way to fix this is to run it in a pseudo-terminal.

+1
source

All Articles