Bug 158726 - make it easier to not select final newline
Summary: make it easier to not select final newline
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: copy-paste (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-03 18:32 UTC by Matthew Woehlke
Modified: 2022-05-26 08:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Woehlke 2008-03-03 18:32:57 UTC
Version:           2.1 (using Devel)
Installed from:    Compiled sources

One selects the trailing newline by selecting past the final "real character". This is good and desirable (as discussed to death in e.g. bug 89299 and bug 152774 ;-)) but is problematic in that the selection is very touchy, making it hard to *not* select the newline. To hopefully satisfy the legitimate complaints of people that do not want the trailing newline, we should make it easier to select without the trailing newline.

One thought is that to get the newline, one must select ~5 characters past the final character, or some percentage (maybe 40%) of the remainder of the line, whichever is smaller. This way there is a much bigger 'hit area' in which one can select the whole line without trailing newline while the 'hit area' for selecting with the newline is still large and easy to hit, as opposed to the current behavior where the 'hit area' to select without the newline is about the size of one character cell.
Comment 1 Mike 2008-03-03 19:22:53 UTC
Also it would be good if the selection would jump to the end of the line once the newline is selected, it would add some visual feedback.
Comment 2 Matthew Woehlke 2008-03-03 20:03:39 UTC
> Also it would be good if the selection would jump to the end of the line once the newline is selected

Unless I miss something, this is how things work today? The suggested change is that you would have a wider space before the visible selection would jump from just the last character (newline not selected) to the whole line (newline selected). Besides, this is how other editors (e.g. katepart) work already.

Actually, in katepart, to select the newline, you must have the cursor on the next line (at column 0, unless you want also characters from the next line). Maybe people would be OK with Konsole working this way? (I'm on the fence if it would be ok or drive me nuts, there is some advantage to konsole's way... probably I would have to try it for a while.)
Comment 3 Gildardo Adrian Maravilla Jacome 2011-08-12 07:26:00 UTC
Hi, using konsole 2.6.4 with KDE 4.6.5 copy a the newline if you select an extra space at the end of the command and it doesn't jump to the final of the line to tell you that.
Comment 4 tcanabrava 2022-05-26 08:19:34 UTC
Git commit 836b1d981485717d1cb6738ef0a901c3600d4742 by Tomaz  Canabrava, on behalf of Luis Javier Merino Morán.
Committed on 26/05/2022 at 08:12.
Pushed by tcanabrava into branch 'master'.

Selecting past last char -> extend to last column

When selecting past the last character, extend the selection to the last
column.  This allows the user to know when the selection has extended
past the last character on a line, even in the presence of trailing
spaces, and will get a newline added to the last line.

This is the behavior of xterm, VTE and rxvt.  mlterm doesn't allow
selections to extend past the last non-space character on a line.
Related: bug 413426

M  +36   -2    src/Screen.cpp
M  +2    -1    src/Screen.h
M  +3    -3    src/ScreenWindow.cpp
M  +1    -1    src/ScreenWindow.h
M  +2    -2    src/autotests/ScreenTest.cpp
M  +4    -4    src/terminalDisplay/TerminalDisplay.cpp
M  +5    -0    src/terminalDisplay/TerminalDisplay.h
M  +1    -1    src/widgets/TerminalDisplayAccessible.cpp

https://invent.kde.org/utilities/konsole/commit/836b1d981485717d1cb6738ef0a901c3600d4742