== The shift-selection trick in X terminal programs Seeing [[this http://twitter.com/zaitcev/status/2880884065]] today reminded me of a relatively obscure feature and counter-feature in _xterm_ and similar imitators like gnome-terminal and konsole. First, the feature (sometimes 'feature'): in order to let text mode programs still have clickable objects, _xterm_ lets programs steal left mouse (button-1) clicks; instead of selecting text, the program gets escape sequences that tell it about the click and it can do whatever it wants with them. The most obvious application is text-mode web browsers like _links_, which uses it to let you click on links. (The [[Xterm Control Sequences http://invisible-island.net/xterm/ctlseqs/ctlseqs.html]] documentation calls this 'mouse tracking'.) This spawned an immediate demand for a counter-feature, and so in _xterm_ and its imitators ~~shift plus left mouse button always selects text~~, even if a program has put _xterm_ in this special mouse tracking mode. In _xterm_, all of the usual double and triple click selection tricks work when shifted; your mileage may vary in gnome-terminal et al. This doesn't seem to be documented in the _xterm_ manpage, so I'm not sure where I learned it; it may have been ambient X knowledge at some point back in the days, and I just picked it up. It's fortunate that it seems to have been well enough known to be copied by the people writing gnome-terminal, _konsole_, and so on. (_xterm_ has a great deal of [[peculiar features ../sysadmin/XtermZiconbeep]] that are at best half-known these days, or that usually take careful study of the manpage to spot.)