Conversation
Neat! It may take me a few days to read all this, but sounds good! |
Send xterm mouse tracking codes
Looks good! -- The code that converts screen coordinates into character coordinates should guard against overflowing bytes. Seems like there should be some Math.min(191,xxx) statements in a few places. |
I agree with using As for your other comments, they appear to be in reference to intermediate versions of the code, not the final version that I intended. For example, the commented out code you mentioned was only commented out as an experiment and the changes to pushAndRun were only for personal use and I reverted them before submitting the pull request. So why were these changes even visible as you were evaluating the pull request? Did I do something wrong with git? I am a bit inexperienced with sending pull requests, so your help in clearing up this matter will be appreciated. |
Hi Dan, Yes, please make the Math.min() change yourself. Ideally as a stand-alone The way git works, when you create a pull request, git will send each of For this CL I started reviewing your checkins one-by-one, then realized In the future you might want to look into the "git rebase" command. This Some people send me one commit for each feature they implement, so I can It's tricky to learn how to rebase commits, but once you know how, it is Note that you should only use git rebase on ranges of CLs that you haven't On Sun, Jul 21, 2013 at 2:22 PM, Dan Stahlke notifications@github.comwrote:
|
Thank you for taking the time to write this very informative reply. I will make sure to use rebase in the future. Shortly I will send a pull request for the Math.min change. Or perhaps it would be better to just ignore presses outside of the defined range. I'll give it a few minutes thought. As for the However, I am occasionally thinking of other ways the touchscreen could be used, such as for repositioning the cursor on the command line, or useful options such as making the bottom line easier to click (useful for switching between windows in tmux). So maybe I will send some more pull requests when I get more free time. |
A question before I do the clipping fix: you say there may be overflow for x >= 192. But 192+32=224. Wouldn't overflow only occur for x > 255-32 = 223? |
Heh, yes your math is right. I subtracted wrong.
|
This patch provides an option to send xterm mouse tracking codes to the terminal. When the option is enabled, and when the console application requests mouse tracking, tap events are forwarded as clicks and drag/fling events are forwarded as scroll wheel events. Examples of applications which can be configured to accept mouse events are
vim
andtmux
.Currently
less
does not scroll. Terminals such as gnome-terminal and konsole forward scroll events as cursor keys when applications are using the alternate screen buffer. If the present patch is accepted, I plan to next implement this kludge so thatless
can scroll as well.I have not implemented the DEC save and restore commands for the mouse tracking flags, although this probably doesn't matter. Probably the way forward here is to use a BitSet rather than an integer to store the flags, as this will enable handling flags greater than 32 in a unified way.