On Wed, 5 Dec 2007 12:08:55 -0600, "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
On Dec 5, 2007 9:19 AM, Enrico Tröger enrico.troeger@uvena.de wrote:
I'm not sure at all whether the way I did it in the patch is good, whether we should it in this way or whether there is any better way (I hope so).
Here is another idea - This patch issues a {HOME} escape sequence before "typing" the command, and then adds a " #" comment marker after it, so anything already on the command line becomes a comment.
It seems to work for me, but I'm not sure if the "\e[H" escape sequence is valid for all keyboards.
It also won't work unless the {HOME} key is bound to "beginning-of-line" (I assume that it is for most humans).
Nice idea but doesn't work in zsh and dash (both with default configurations tested on Debian Testing). Additionally, zsh seems to have problems with the '#' in a command: cd /tmp # doesn't work in zsh.
I don't know much about shells(just using bash and being happy ;-)), the manual page for dash doesn't mention any escape sequences at all ;-(.
Just another idea(probably not better): In the key-press event handler we look for any typed characters (or for a changed cursor position) and if found, we mark the VTE as "dirty" so that commands can't be run until the user marked the VTE as clean again (e.g. by restarting it).
Regards, Enrico