Summary: | Konsole is copying text I don't want | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Alexander Nestorov <alexandernst> |
Component: | copy-paste | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | a.samirh78, alexandernst, amichai2, arjunak234, creffett, dane, Ed.Greshko, flying-sheep, ionut.leonte, jhtrees99, joshchia, jramirez.uy, jwelsh, kde, kde, kdebugs, khindenburg, luis.st, lumetili, master.homer, me, paul+kde, rdieter, rob, rootkit85, setton.mail, shawn.starr, steven |
Priority: | NOR | ||
Version: | 3.0.1 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Text after copy
attachment-1622-0.html |
Description
Alexander Nestorov
2015-02-03 10:39:36 UTC
Created attachment 93902 [details] attachment-1622-0.html >If I copy something from Konsole and paste it in a Hangouts window, the text I copied is pasted, but the text "Konsole output" is prepended. I can't reproduce this. How are you copying the text? Do you face the same issue when pasting to some other application? I copy it with right click -> copy text. Certainly, this happens only with Hangouts (I tried Kate, Skype, Konsole itself, Chrome and Firefox). I'd think Hangouts (the plugin, not the embedded chat in gmail) is making this, but how can that be? Hangouts doesn't have enough capabilities to actually check from where the text is coming from. I am also seeing this and it's incredibly annoying. Seems to be happening with applications that allow for 'rich text' to be copy-pasted around to maintain formatting. Easily reproducible with Pidgin by copying colored text from Konsole and pasting it into a chat field - I am now getting fully-formatted text being pasted including colors. I'm using Konsole from KDE 5 (Konsole version 3.0.1 Using KDE Frameworks 5.6.0). (In reply to Ionuț Leonte from comment #3) > I am also seeing this and it's incredibly annoying. Seems to be happening > with applications that allow for 'rich text' to be copy-pasted around to > maintain formatting. Easily reproducible with Pidgin by copying colored text > from Konsole and pasting it into a chat field - I am now getting > fully-formatted text being pasted including colors. > > I'm using Konsole from KDE 5 (Konsole version 3.0.1 Using KDE Frameworks > 5.6.0). Forgot to mention: only the 'rich text' version of the copied data seems to have 'Konsole output' added. Again using my Pidgin example above, if I right-click the chat field and use 'Paste as plain text' instead I get only the text that I actually copied from Konsole without anything added to it. Created attachment 90960 [details]
Text after copy
I'm copiyng from konsole via "Ctrl+shift+c" or via right-click menu (it's doesn't matter) text "eeghechohGoh6od"
and pasting via "Ctrl+v", or "Shift+insert", or right-click menu (doesn't matter) - and it's looks like this.
Possibly related, and this has been bugging me for a while: After upgrading from Konsole 2.x to 3.x, dragging a link from Chromium to konsole shows the link text instead of the link target (URL). Steps to reproduce: 1. Open Chromium and visit any website. 2. Open Konsole. 3. Drag any link (e.g. the favicon in the omnibox, or a link in the page) from Chromium, and drop it at Konsole. Before (2.x): A contextmenu appears, and I can choose to "copy", "link" or paste the dropped link target. E.g. https://bugs.kde.org/show_bug.cgi?id=343726 After (3.x): The link text is pasted. For example, if I drag the URL of this page from Chromium 41.0.2272.77 (and 39.0.2171.71) to Konsole 3.0.1, I get the following (note the lot of null bytes, it seems to be a urlencoded UTF-16-encoded string). '' '%00B%00u%00g%00 %003%004%003%007%002%006%00 %00%13 %00K%00o%00n%00s%00o%00l%00e%00 %00i%00s%00 %00c%00o%00p%00y%00i%00n%00g%00 %00t%00e%00x%00t%00 %00I%00 %00d%00o%00n%00'\''%00t%00 %00w%00a%00n%00t' I looked into the code, and saw that TerminalCharacterDecoder.cpp is responsible for what the copied text contains, Basically, that text is in HTML, with a title tag that says "Konsole output". I'm not sure why a title tag would be required there, so I tried removing it from the code, and that seems to have fixed it. Added Kurt Hindenburg to the CC list as he was the one who committed the HTML related code (http://quickgit.kde.org/?p=konsole.git&a=commit&h=a4aa495c75bad7e2790899678a06fc714b086534). yeah so it gets a title tag containing “Konsole output” how is the specification of rich text copying? should it be a full document or just a fragment? if full document, we’re doing the right thing, and hangouts/thunderbird/… are in the wrong if fragment, we should just revert that commit, because before it, we did emit a fragment. --- what i think: the unified handling of “Save as” and “Ctrl+C” is at fault. “Save as” should wrap it in a whole HTML document, “Ctrl+C” should only copy a fragment. I've managed to workaround it by erasing the string "<title>Konsole output</title>" in /usr/lib/x86_64-linux-gnu/libkonsoleprivate.so.3.0.1 with an hex editor Also happens when just using the cut buffer (select + middle click), with Pidgin. Should that really be using rich text in the first place? Can confirm this also happens on Fedora 22. This is a very annoying problem as it causes grief when pasting text into T-Bird. I had filed a BZ on this as https://bugs.kde.org/show_bug.cgi?id=349261 but I think it is probably the same issue. This problem started happening to me when I upgraded to KUbuntu 15.04 - click/drag to select text in Konsole and then middle mouse in, say, pidgin chat text and I get "Konsole output" prepended to the text. Googled for a solution, found this page. I can confirm this and I cannot emphasize enough how annoying this is. Please disable this or make it configurable! I do not want formatted/HTML/prefixed text when I copy something from the console. This just interrupts so many workflows. Workaround for this and #343321 on Fedora 22: dnf erase konsole5 && dnf install konsole Just confirming that this also happens to me (Version 3.0.1 Using KDE Frameworks 5.9.0). Would be awesome if it could be disabled. This has bit me so many times. It's quite dangerous if you need to paste something from konsole into an application that expects a fragment (which seems to be everything), and some business logic processes the test - now you've broken something. To be perfectly honest though, I can't fathom why it would ever be a good idea to copy rich text from the terminal anyway - generally I specifically *don't* want any extra wacky formatting cruft being added to my terminal output when I copy it, regardless of where I'm going to paste it. All that said, if the world expects something else, it's not practical to suddenly break the world because you're technically right (I don't know or care who is technically right in their implementation(s) here). So, if Konsole is going to continue copying as rich text (I wish it wouldn't), it doesn't matter whether or not Konsole is technically right, this behaviour should be reverted to producing a fragment. Please revert this git commit or provide an option to disable rich text copying mode. When I Ctrl-v into Pidgin, I get the weird 'Konsole ...', when I Ctrl-Shift-v into Pidgin or Ctrl-v into Chrome, I get normal content. Maybe something got lost in translation in the clipboard so that somehow Chrome is not affected by pidgin is. (In reply to joshchia from comment #20) > When I Ctrl-v into Pidgin, I get the weird 'Konsole ...', when I > Ctrl-Shift-v into Pidgin or Ctrl-v into Chrome, I get normal content. Maybe > something got lost in translation in the clipboard so that somehow Chrome is > not affected by pidgin is. Chrome simply doesn't support rich-text paste in that case. Here's the thing, if there is enough people complaining, i'll revert the git commit until we have a proper solution in place. The important thing to know here is what exactly is supposed to do the mentioned commit? Is the behavior in this bug the only thing that is supposed to do? If yes, then I'd say you should revert it. If no, what are the benefits of keeping it? What applications/use cases need this feature? El mié, 5 de agosto de 2015 17:14, Shawn Starr <shawn.starr@rogers.com> escribió: > https://bugs.kde.org/show_bug.cgi?id=343726 > > --- Comment #22 from Shawn Starr <shawn.starr@rogers.com> --- > Here's the thing, if there is enough people complaining, i'll revert the > git > commit until we have a proper solution in place. > > -- > You are receiving this mail because: > You reported the bug. > You are on the CC list for the bug. > count me as a complainer. as a sysadmin I do a lot of copy/pasting from terminals, and this "feature" is 99% bug to me. Count me in as a complainer too! +1 @Paul Mansfield (In reply to Shawn Starr from comment #22) > Here's the thing, if there is enough people complaining, i'll revert the git > commit until we have a proper solution in place. How many is enough? I'm sure I can go find some people to complain if that's what's necessary :-/ Yeah I just got bitten by this. Start composing mail in Thunderbird, change it to plain text format. Paste text in from Konsole. Only the normal paste is visible. Send the message. The sent message will include the header "Konsole output" before the paste even though it's not visible whilst sending. Nice going Thunderbird too for not converting the editor to plaintext when you're going to send it like that... +1 @Paul Mansfield This finally bugged me enough today to find/submit a bug on it. I deal with a lot of non-linux savvy people that use linux so having in my "run this command `Konsole output....`" and getting "it didn't work, 'Konsole command not found'"... yeah. But thanks for trying to keep us up to date with more advanced coping. I've asked the committer for comments, we should have this sorted soon(?) I'm working on this - there are a number of things wrong here. Git commit 7d22259af621b0fc115e42f263ef5b6a3c7e1c9d by Kurt Hindenburg. Committed on 15/08/2015 at 01:48. Pushed by hindenburg into branch 'master'. Revert "For HTML output, create a full .html file" This was meant when using File->Save Output->HTML. However, it has the side effect of making copy/paste Mime(HTML) output a full HTML page. This reverts commit a4aa495c75bad7e2790899678a06fc714b086534. M +1 -14 src/TerminalCharacterDecoder.cpp http://commits.kde.org/konsole/7d22259af621b0fc115e42f263ef5b6a3c7e1c9d Git commit f14e91b62f4b85ea145b2569d533bcaabc73a0ad by Kurt Hindenburg. Committed on 15/08/2015 at 02:24. Pushed by hindenburg into branch 'Applications/15.08'. Revert "For HTML output, create a full .html file" This was meant when using File->Save Output->HTML. However, it has the side effect of making copy/paste Mime(HTML) output a full HTML page. This reverts commit a4aa495c75bad7e2790899678a06fc714b086534. (cherry picked from commit 7d22259af621b0fc115e42f263ef5b6a3c7e1c9d) M +1 -14 src/TerminalCharacterDecoder.cpp http://commits.kde.org/konsole/f14e91b62f4b85ea145b2569d533bcaabc73a0ad Really annoying bug. Happens both with Ctrl-Shift-C and when just highlighting with mouse and pasting with middle button. So is this just confirmed, or also fixed? And why on earth is text from a terminal being copied as HTML/rich text in the first place? It's a terminal - nobody cares about colors and fonts. They are actually quite annoying even if the "Konsole Output" prefix wasn't there. How about just copying the plain text to the clipboard by default? If there's anyone out there that really needs rich text copied from a terminal window, make that a separate Edit/context menu option for them. This is fixed on Archlinux (konsole 15.08.1) Have to admit a bit surprised to see this bug still open. It's fixed under Fedora 27 (konsole5-17.12.1-1.fc27.x86_64). Thanks for checking, I'll close it then. |