Cannot select single character
By geor...@google.com on July 29, 2010 17:13 (imported from Google Code)
Copied from iTerm1 bug 2995208:
I often want to highlight just a single character with my mouse (e.g. for copy-pasting a special Unicode character). With iTerm 0.10 it's not possible: one can only highlight at least two characters.
Unfortunately this behavior is not unique to iTerm, some other terminal emulators suffer (or used to suffer) from the same problem due to an incorrect interpretation of click coordinates.
Apparently what iTerm does: it checks in which charcell I clicked, and which charcell I've moved the mouse to, and highlights everything between them, inclusive.
Apart from selecting at least two cells (which most annoys me), there are other disadvantages of this behavior.
Example1: click on a character, and move the mouse up-down. The character on which you originally clicked will be highlighted both when you extend the selection backwards or forwards. This is not consistent with the behavior of other graphical applications (incl. Mac's default terminal). With other applications, if you have the string 'abcdefghijkl' and you click somewhere between 'e' and 'f' (or close to that), you'll either get '...e' or 'f...' selected based on the direction. In iTerm, if you click on 'e', you either get '...e' or 'e...' based on the direction.
Example2: Suppose you have 'abcdefghijkl' printed and want to highlight 'fgh'. Since you know that you want to exclude 'e' but include 'f', you're likely to try to click near the boundary between 'e' and 'f'. If you happened to click on the left side of 'f', you'll get the desired selection, but if you happen to click on the right side of 'e', you'll include this letter too.
The behavior of every other graphical application, and also terminals doing the right thing (incl. Mac's terminal) is the following: As for the vertical coordinate, you just locate which row the current coordinate belongs too, this is okay. But, for the horizontal coordinate you should shift the boundaries by a half character cell. It doesn't matter in which charcell the used clicked in. Clicking on the righthand edge of the letter 'e' above should be the same meaning as clicking on the lefthand edge of letter 'f', but not the same as the righthand edge of 'f'. Instead of the charcell, what you'd need to locate is the closer charcell boundary; both for the beginning and the end of the selection. And then the selection itself is obviously the stuff between these two boundaries.
(The behavior of iTerm vs. other applications is most observable if you set a huuuuuuuge font for testing purposes.)