Bug 368122

Summary: URLs get concatenated with first word after newline
Product: [Applications] konsole Reporter: Nemo <federicoleva>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: niklas.laxstrom, sebastian.englbrecht
Priority: NOR    
Version: 15.12.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: investigated, triaged
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Example from IRC on irssi
Example from IRC on irssi: selection of 4 lines, of which 2 ending with an URL

Description Nemo 2016-09-01 20:16:38 UTC
I'm often unable to click or right click URLs in Konsole because they get garbled with extraneous text just because they come at the end of a line, which happens frequently e.g. in IRC messages containing a link as last thing.

Reproducible: Sometimes

Steps to Reproduce:
1. Open a CLI program which sometimes outputs URLs at the end of a line, like irssi
2. Get an URL + newline + non-space characters sequence printed, with the URL long enough but not so much as to be wrapped
3. Hover/select/click/copy the URL

Actual Results:  
The first word after the newline is selected together with the URL as if it were part of the URL. The URL most likely becomes invalid.

Expected Results:  
The URL is terminated by the newline.

The bug has appeared in the last few days for me on fedora 23 stable. I'm not aware of any other involved software having changed.
Comment 1 Nemo 2016-09-01 20:17:09 UTC
Created attachment 100888 [details]
Example from IRC on irssi
Comment 2 Kurt Hindenburg 2016-09-17 16:59:04 UTC
It looks like Fedora 23 was release last Nov - I'm not sure what KDE version that corresponds to.

It would be helpful if you could provide a link that easily shows this issue.  

There are some test urls in the file https://quickgit.kde.org/?p=konsole.git&a=blob&h=c3750b965616764ae5c782ec602caf3ac2aeefe5&f=tests%2Fcat_test_urls&o=plain which I try to verify these issues.
Comment 3 Nemo 2016-09-18 08:54:59 UTC
Sorry, I don't understand the request. The link doesn't matter, any URL has the same effect as long as it's the last thing on a line.

Thanks for the link to the tests; I see you have many URLs, but do you also test them in different scenarios? Like whether the URL gets wrapped because the terminal is less wide than the URL is long, or whether the URL is followed by an interpunction sign, or whether it's followed by a newlines followed by some character.

The Konsole version is stated in my report, 15.12.3; right now I have KDE Frameworks 5.25.0, Qt 5.6.1 if that helps.
Comment 4 Nemo 2016-09-25 17:38:04 UTC
I notice that, if and only if the bug appears, when I select the line containing the URL as last thing and the following line, copy and paste, there are a bunch of spaces after the URL; when the bug doesn't appear, the paste has the URL correctly followed by a newline.
Comment 5 Niklas Laxström 2017-01-27 07:48:56 UTC
This also started happening to me in last few days.

Latest konsole updates:
grep konsole /var/log/zypp/history
2016-12-16 23:18:14|install|konsole-part|16.08.3-2.1|x86_64
2016-12-16 23:25:21|install|konsole|16.08.3-2.1|x86_64
2016-12-20 19:07:02|install|konsole-part|16.12.0-1.1|x86_64
2016-12-20 19:07:07|install|konsole|16.12.0-1.1|x86_64

Or more likely one of these:
cat /var/log/zypp/history | egrep 'install\|(k|libk)' 
2017-01-25 16:01:02|install|kde-l10n-fi|16.12.1-1.1|noarch
2017-01-25 16:01:44|install|kactivitymanagerd|5.8.5-1.1|x86_64
2017-01-25 16:01:44|install|kcm_sddm|5.8.5-1.1|x86_64
2017-01-25 16:01:45|install|kde-cli-tools5|5.8.5-1.1|x86_64
2017-01-25 16:01:45|install|kde-user-manager|5.8.5-1.1|x86_64
2017-01-25 16:01:46|install|ksh|93v-6.15|x86_64
2017-01-25 16:01:46|install|ksshaskpass5|5.8.5-1.1|x86_64
2017-01-25 16:01:49|install|libkerfuffle16|16.12.0-2.1|x86_64
2017-01-25 16:02:07|install|libkscreen2-plugin|5.8.5-1.1|x86_64
2017-01-25 16:02:08|install|libkms1|2.4.74-1.1|x86_64
2017-01-25 16:02:10|install|libkdecorations2-5|5.8.5-1.1|x86_64
2017-01-25 16:02:11|install|libkf5kdegames6|16.12.1-1.1|x86_64
2017-01-25 16:02:16|install|kscreenlocker|5.8.5-1.1|x86_64
2017-01-25 16:02:17|install|kscreen5|5.8.5-1.1|x86_64
2017-01-25 16:02:22|install|kpat|16.12.1-1.1|x86_64
2017-01-25 16:02:23|install|khotkeys5|5.8.5-1.1|x86_64
2017-01-25 16:02:24|install|kdebase4-workspace-libs|4.11.22-6.10|x86_64
2017-01-25 16:02:39|install|kwin5|5.8.5-1.1|x86_64
2017-01-25 16:02:48|install|kscd|16.12.1-1.1|x86_64
2017-01-25 16:03:08|install|kgpg|16.12.0-2.1|x86_64
2017-01-25 16:03:36|install|ktnef|16.12.0-2.1|x86_64
2017-01-25 16:04:07|install|kdepim-apps-libs|16.12.0-1.2|x86_64
2017-01-25 16:04:46|install|kde-gtk-config5|5.8.5-1.1|x86_64
2017-01-25 16:11:43|install|kio_audiocd4|16.08.3-1.1|x86_64
2017-01-25 16:11:44|install|libkolab1|1.0.2-4.2|x86_64
2017-01-25 16:11:47|install|kdepim-runtime|16.12.0-2.1|x86_64
Comment 6 Nemo 2017-01-27 08:01:23 UTC
Created attachment 103661 [details]
Example from IRC on irssi: selection of 4 lines, of which 2 ending with an URL

I confirm I still have the problem in konsole 16.08.3 (KDE Frameworks 5.29.0, Qt 5.7.1).

For instance, the selection in the screenshot attached produces the following clip:

06.57 -rakkaus:#mediawiki-i18n- [] You can process them at https://translatewiki.net/wiki/Special:ManageMessageGroups/unattended
07.49 -!- Raymond_ [~Raymond@wikipedia/Raymond] has joined #mediawiki-i18n
07.58 -rakkaus:#mediawiki-i18n- [] Raymond: https://translatewiki.net/wiki/Special:ManageMessageGroups/mediawiki                               08.27

Note that "08.27" is preceded by a bunch of spaces rather than a newline. The spaces and the first word of the following line are considered part of the URL when clicking it.
Comment 7 Sebastian 2018-10-30 22:56:04 UTC
Note: I am no maintainer but from the bugsquad.

Hello Nemo,

I think I understood your problem and tried to reproduce it on my system, which I was not able to.

For me all urls get marked correctly and I also can copy the correct url.

Could it be that the issue was resolved in the meantime?
Is it still happening to you?

System Information:
konsole 17.12.3
kde-plasma-version: 5.12.6
kde-frameworks-version: 5.44.0
qt-version: 5.9.5
Comment 8 Nemo 2018-10-31 06:32:12 UTC
Thanks Sebastian for checking.

I've not experienced the problem in a while. I've just checked on Konsole 17.12.2 and I can't reproduce attachment 100888 [details] i.e. simply having an URL as the last "word" of a line. Newlines seem to be preserved in copy and pasting as well.
Comment 9 Niklas Laxström 2018-10-31 06:45:26 UTC
This still happens to me, albeit not too frequently. But I am on 16.12.0 (Debian) so maybe it is fixed on a newer version.
Comment 10 Sebastian 2018-10-31 08:09:08 UTC
Thanks to both of you for answering this fast!

@Nikolas: I would appreciate of you could inform us/me here if you encounter this again, so that I can verify that it works for newer versions.

I'll also have a closer look on links in the meantime
Comment 11 Bug Janitor Service 2018-11-15 10:56:32 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 Bug Janitor Service 2018-11-30 04:08:44 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!