Bug 223172 - copy-pasting from scrollback buffer appends spaces at end of line
Summary: copy-pasting from scrollback buffer appends spaces at end of line
Status: RESOLVED DUPLICATE of bug 188528
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.2.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-17 17:58 UTC by Alain Knaff
Modified: 2010-01-17 18:17 UTC (History)
1 user (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 Alain Knaff 2010-01-17 17:58:10 UTC
Version:           2.2.3 (using 4.2.4 (KDE 4.2.4), Kubuntu packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.28-17-generic

When selecting a line which has scrolled off-screen, copy-pasting often appends a number of spaces to line.

How to reproduce:
1. In a shell, type "echo test"
2. You should see the following:
> echo test
test
3. Copy-paste both lines elsewhere (for example into an emacs)
4. Check the length of the pasted lines (for example, by moving into the line in your emacs, and then typing End, and see where the cursor ends up) => lines are ok.
5. Now, in konsole, type <Enter> often enough to make both lines scroll off screen
6. Use the scrollbar to bring them back into visibility.
7. Copy-paste them again into emacs
8. Now, the second line ("test") has enough spaces appended to make it as long as the preceding line ("> echo test")

Some tests with different commands show that the number of spaces depends on previously output lines of same shell command: there are always enough extra spaces added to make the pasted line as long as the longest preceding line of the same command (tested using head /etc/passwd).

It's weird how the bug only "takes into account" the lines making up the current command (command itself + any output), and seems to be reset for the next command.

Some further test showed that:
1. It can't be fooled neither with sleep's in the command, nor echo -n '> '
2. It does seem to depend on the shell used: it resets the current maximum length between commands in zsh, but not in bash
3. It behaves the same, no matter whether it's the shell launched directly by konsole, or a subshell. Weird stuff...
Comment 1 Kurt Hindenburg 2010-01-17 18:17:16 UTC

*** This bug has been marked as a duplicate of bug 188528 ***