LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-05-2017, 06:18 AM   #1
fluix
LQ Newbie
 
Registered: Apr 2017
Posts: 5

Rep: Reputation: Disabled
Konsole mouse triple-click trailing newline drives me ...


Hello there,

My problem is about usability of Konsole (a linux terminal emulator, v. 16.12.3 under gnome 3.22.3): the triple-mouse-click copy of text.

I often triple-click with mouse on a line of Konsole's output with the intend to copy it and later paste it (possibly at the command line of another Konsole).

However, there is a last newline in that copied text (which I guess is right there in the terminal's output, no dispute about that) which also gets into the copied text. In effect mouse triple-click copies into buffer the whole line PLUS a newline at the end.

Nothing wrong with that except when I later paste the text on a terminal emulator, at the command line, that last newline snickily acts as a 'press enter' and automatically sends the whole pasted text to the shell for processing it without ME hitting Enter but the paster!

I don't say this is not expected behaviour or a bug. But it can surely lead to evil exploits...

Consider copying 'rm -rf /' in order to paste it into another command line *but modify* it before pressing Enter and execute it, e.g. 'rm -rf /tmp/*.log' and Konsole's paste action hits that Enter before modification...

A scenario which can happen to a new user (and any user when dealing with complex/cryptic commands) when copy-pasting from a README file etc. (Thankfully it does not happen when triple-clicking from Firefox onto Konsole!).

I would like to know whether there is an option to remove THE LAST TRAILING NEWLINE (or other spaces) from the text via the mouse triple-click action. (There is no need to remove all newlines - that will cripple it because in that case obviously someone is copying some text like a poem or something. Just the last one).

FYI: Konsole's preferences under Mouse tab has 'Trim trailing spaces' tick-box but that does absolutely nothing either on literal trailing spaces or trailing newlines. Unless I am doing something wrong?

FYI2: iTerm on Mac OSX behaves sensibly in the sense that it does not need to be told to remove trailing newlines from copy-paste - it does it by default. I would urge Konsole's or Terminal's developers/designers to have a look at iTerm and a lot of other OSX programs which in term of human-computer-interaction are champions.

As a general suggestion: Copy-paste is crucial. We need more complexity to the logic of it. We need many levels (e.g. like the double/triple clicking) of it, each level copying a certain part of the text.

best wishes to all open-source developers and thanks for Linux (can't live or earn my bread without it!),

a.
 
Old 04-05-2017, 07:06 AM   #2
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 990
Blog Entries: 15

Rep: Reputation: 135Reputation: 135
Check the option in "edit current profile" -> Mouse-> "Trim trailing spaces"

I like this behaviour, because every time I see it, it reminds me of the dangers of copying commands.
 
Old 04-05-2017, 07:31 AM   #3
fluix
LQ Newbie
 
Registered: Apr 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
serafean,

I ticked that box as I mentioned in my post but nothing changes.

thanks,
 
Old 04-05-2017, 07:33 AM   #4
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 990
Blog Entries: 15

Rep: Reputation: 135Reputation: 135
In that case : https://bugs.kde.org/
 
Old 04-05-2017, 07:39 AM   #5
fluix
LQ Newbie
 
Registered: Apr 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Some more triple-click woes

Once I am at it, and always in the context of Konsole,

I also have to note the inconsistent behaviour between copying (by mouse triple-click) a line from the output of 'more' and copying in exactly the same way from the output of 'head', 'cat'.

% more filename.txt

Then copying one line of text from the above command will stop at the end of the window (and not at the end of the actual line)

However, with

% cat filename.txt

triple-click on any line will copy till the end of the line (as it appears in the 'filename.txt') ignoring where the line breaks because of window width (as it should be).

Must have to do with this programs using additional newline signifiers?

This behaviour I think also happens in other terminal emulators, but can't be sure which.

Want to do good in the open-source? Fix these little daily nuances rather than inventing the new gnome behemoths and breaking our nerves with, for example, 'the terminal is ready'!!!!

a.
 
Old 04-05-2017, 11:12 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,401
Blog Entries: 10

Rep: Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212
the terminal is ready?
never seen that.

but, fwiw, this behavior is not specific to konsole; my urxvt has the same triple-click behavior: select the full line, incl. trailing newline.
...and can be changed with a commandline option and/or resource

Last edited by ondoho; 04-05-2017 at 11:13 AM.
 
Old 04-05-2017, 04:34 PM   #7
fluix
LQ Newbie
 
Registered: Apr 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
" ...and can be changed with a commandline option and/or resource "

any pointers please? this could be the solution to my problem.



"... terminal is ready"

i guess it is 'the window is ready' (already there is a remover https://extensions.gnome.org/extensi...ation-remover/ just like with the B.Gates' enterprise).
 
Old 04-06-2017, 11:50 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,401
Blog Entries: 10

Rep: Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212
Quote:
Originally Posted by fluix View Post
any pointers please?
we're talking about a different terminal emoulator, called rxvt-unicode, command urxvt.
Quote:
Originally Posted by man urxvt
-tcw
Change the meaning of triple-click selection with the left mouse button. Only effective
when the original (non-perl) selection code is in-use. Instead of selecting a full line
it will extend the selection to the end of the logical line only. resource
tripleclickwords.
...
tripleclickwords: boolean
Change the meaning of triple-click selection with the left mouse button. Instead of
selecting a full line it will extend the selection to the end of the logical line only;
option -tcw.
Quote:
Originally Posted by fluix View Post
'the window is ready' (already there is a remover https://extensions.gnome.org/extensi...ation-remover/ just like with the B.Gates' enterprise).
one has to install an extension to remove a nagging notification???
quo vadis, gnome?

Last edited by ondoho; 04-06-2017 at 11:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sed remove trailing newline nc3b Programming 20 06-26-2015 11:02 AM
Mouse Single-Click-Drag Interpreted as Double Click artvarck Linux - Desktop 1 03-11-2014 07:47 AM
[SOLVED] Where did the trailing newline characters go luvshines Linux - Newbie 4 08-12-2011 11:56 PM
Mouse trailing effect... possible? oxi Linux - Desktop 0 11-05-2006 01:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration