OhmNomNom / thyme

A fork of mintty, for the modern world
GNU General Public License v3.0
0 stars 0 forks source link

Keep selection on keyboard input #222

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Is it possible to add a feature so that selected text is kept highlighted on 
screen after input from the keyboard?  For example in putty, if you select part 
of your command prompt and begin to type, then the selection stays highlighted. 

A further more useful example of this is scrolling through files in less.  In 
putty I am able to open a file in less, select some text and then scroll down 
using the cursor keys on my keyboard whilst keeping the selection in focus.  
This is quite an important thing for me, so I'm unfortunately considering going 
back to puttycyg for the time being :(

Original issue reported on code.google.com by jstockto...@gmail.com on 28 Sep 2010 at 1:28

GoogleCodeExporter commented 9 years ago
You don't mention how that would be useful to you. Clearing the selection on 
input is standard Windows behaviour, and the clipboard content of course 
remains untouched by the selection being cleared.

Original comment by andy.koppe on 28 Sep 2010 at 8:08

GoogleCodeExporter commented 9 years ago
it would be useful in that for my job I need to copy pages and pages of 
continuous text from remote machines using less.  I need to be able to clearly 
mark where I have copied up to after moving using the cursor keys.  I'm not 
particularly  confident of capturing it from the scroll back as scrolling text 
in less doesn't seem to log to the scroll back correctly.

Original comment by jstockto...@gmail.com on 29 Sep 2010 at 8:10

GoogleCodeExporter commented 9 years ago
I'm afraid I'm not convinced by that use case. Surely there are better ways to 
copy that text than page-by-page via less, for example by teeing the output 
into a file (just in case) and relying on the normal scrollback, whereby 
'Select All' might come in handy.

As for 'less', its whole point is that it does its own scrolling, which is why 
it uses the so-called alternate screen where lines don't go into the terminal's 
scrollback. It can be forced not to use the alternate screen with the -X 
option, but note that if you scroll backwards or jump around in the file, lines 
will appear in the scrollback more than once or not at all.

Without the -X, you can actually avoid the selection in 'less' being cleared by 
scrolling with the mousewheel rather than the keyboard. (You might have to 
switch off the scrollbar for this to work, because on some systems that will 
steal the mousewheel events.)

Having said all that, the selection in xterm, konsole and gnome-terminal is 
actually even more sticky than in PuTTY: it's only cleared if any part of the 
selection is changed, whereas in PuTTY it's already cleared if the cursor moves 
into selection.

The latter is what originally triggered the change to clearing the selection on 
keyboard input (in r139): clearing the selection due to cursor movement proved 
incompatible with the 'Clicks place cursor' feature. That feature should be 
fine with the approach in the other terminals though. So that might be worth 
investigating further.

Original comment by andy.koppe on 30 Sep 2010 at 7:08