Last modified: 2013-06-18 16:56:40 UTC
sql.php seems to be optimized for running pre-prepared scripts, which is all well and good but it would be nice to get the GNU readline goodies when stdin is actually a terminal. The readline stuff is encapsulated in Maintenance::readConsole() which'll return a line at a time. Looks like sql.php sends stdin straight into Database::sourceStream() which does fgets() directly... that'll probably need to be extended to add a callback to override the actual reading, or else clever use of stream wrappers. :)
It looks like this issue has been fixed or maybe I am not understand it. From sql.php : while ( ( $line = Maintenance::readconsole() ) !== false ) { commit ebf916f3fb528bba0fcb5626701815a1810463de