cdir
cdir copied to clipboard
add mouse clicking support
That would be really sweet...
Here's a proof-of-concept: https://gist.github.com/1702813
Totally going to add this.
@hij1nx Awesome :)
Note that I've just updated the gist to be more node version backwards and forwards compatible. Specifically, the keypress
event should not be depended on, and using the correct "setRawMode()" API.
Cheers!
If you need anymore insight, I've spent a lot of time going crazy over all the different terminal mouse protocols:
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#Mouse%20Tracking https://github.com/chjj/tty.js/blob/v0.2.6/static/term.js#L329 https://github.com/chjj/tty.js/blob/v0.2.6/static/term.js#L2939
@TooTallNate picked the right protocol: one that is an extension of the x10 protocol, but with release events, modifiers, and potentially the utf8 extension which allows for large terminal sizes, but the rxvt protocol might be worth supporting too.
It would be cool to eventually get this stuff into core as an event: process.stdin.on('mousedown', ...)
.