Bug 136730 - <ctrl>+mouse copying broken
Summary: <ctrl>+mouse copying broken
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.6.5
Platform: openSUSE Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Konsole Developer
Depends on:
Reported: 2006-11-02 21:03 UTC by Richard Bos
Modified: 2011-08-14 22:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8

join lines by using SPACE as delimiter (1.06 KB, patch)
2011-07-15 19:14 UTC, Jekyll Wu

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Bos 2006-11-02 21:03:22 UTC
Version:           1.6.5 (using KDE KDE 3.5.5)
Installed from:    SuSE RPMs
OS:                Linux

konsole used to have this nice little (hidden) feature that
text could be copied with the mouse _and_ the ctrl key pressed,
now when pasted with (e.g.) the middle mouse button the 'end of line characters are removed from the copied text.  And all
text is written out on a single line.

E.g. text to be copied is:
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be upgraded
  libmyth mythbrowser mythcontrols mythdvd mythflix mythgallery mythgame
  mythmusic mythnews mythphone mythplugins mythtv mythtv-backend
  mythtv-frontend mythtv-setup mythtv-themes mythvideo mythweather mythweb
  perl-xmltv xmltv-grabbers
21 upgraded, 0 newly installed, 0 removed and 36 not upgraded.
Need to get 20.5MB of archives.

- copy with the mouse and ctrl key pressed the indented lines
- the result of the paste action (middle mouse button would be:
 all 21 words (pkgs) on a single line.  Very handy.

Current result is, no feedback or garbled output.  At least
not something expected :(

I don't which kde release broke this... :(
Comment 1 Richard Bos 2006-11-02 21:05:02 UTC
Sorry I hit the <enter> button while editing the title :(
Can somebody update the title to: <ctrl>+mouse copying broken

Comment 2 Richard Bos 2006-11-02 21:45:37 UTC
It works for me with a previous konsole version (1.6.4)
This one is running on suse-10.0

While I found the bug on suse-10.1 konsole-1.6.5
Comment 3 Robert Knight 2008-03-18 03:02:16 UTC
Confirmed that this feature is not present in KDE 4.x
Comment 4 Richard Bos 2009-01-28 23:22:10 UTC
Hi Robert,
the functionality is almost(!) there.  At the moment every copied line is just
pasted after eachother, without spacing.  Now if the space would be there
the functionality would be back again.  The current behaviour is probably
better understood with an example:

kde@eos:~> echo "This
a copy and

Copy the resulting text of the command above with the <ctrl> key pressed.
Pasting with the MMB results in:
Thisisa copy andpastetest

If there would be space at the former NEWLINE positions, this bug could
be closed!
Comment 5 Jekyll Wu 2011-07-15 19:14:25 UTC
Created attachment 61900 [details]
join lines by using SPACE as delimiter

(In reply to comment #4)
> the functionality is almost(!) there.  

You are right :D

This simple patch should make it work as your expectation. It puts a SPACE between joined lines, instead of joining them seamlessly.
Comment 6 Kurt Hindenburg 2011-07-24 20:28:18 UTC
Git commit 4f8da80fec79b8d229bfb75d5825b65a3f4bea61 by Kurt Hindenburg.
Committed on 24/07/2011 at 22:22.
Pushed by hindenburg into branch 'master'.

Use SPACE as delimiter when joining multiple lines.

Currently, when users use ctrl+mouse to select and copy multiple lines,
those lines are joined into single line in a seamless way.  LINEBREAK is
simply removed, thus the first character of second line will be
positioned right after the last character of the first line.  This patch
replaces the LINEBREAK with a SPACE.

Thanks to Jekyll Wu (adaptee@gmail.com) for patch and research.
BUG: 136730

M  +5    -2    src/Screen.cpp

Comment 7 Albert Astals Cid 2011-08-12 12:44:18 UTC
I do not know what is the point of this, but it totally breaks copying text from konsole, adding a space where there is none seems like a totally bad idea to me. Ben from the sysadmin team for example complains now all the ssh key hashes he copies get a space added in the middle.
Comment 8 Kurt Hindenburg 2011-08-12 13:20:56 UTC
#7, Ben and you are using Ctrl+mouse to select text?  or did this patch break normal copy/paste?
Comment 9 Albert Astals Cid 2011-08-14 18:04:54 UTC
No, we use left click mouse to select the text and then use ctrl+shift+c to copy it.
Comment 10 Kurt Hindenburg 2011-08-14 20:48:27 UTC
Jekyll, do you have time to look at this?  If you copy a really long line (past your width) and paste it, there are spaces in it.

Example (assuming your screen width is less than that)

paste will have spaces  at the screen width.
Comment 11 Jekyll Wu 2011-08-14 22:06:38 UTC
Git commit 4dd68c4c5bebbe277595445409533f3265277285 by Jekyll Wu.
Committed on 14/08/2011 at 23:44.
Pushed by jekyllwu into branch 'master'.

Do not append extra space when copying wrapped lines.

This is a fix for the regression caused by commit 4f8da8.

BUG: 136730

M  +12   -9    src/Screen.cpp