Bug 455165 - Characters after column 81 are sometimes not put on clipboard
Summary: Characters after column 81 are sometimes not put on clipboard
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: copy-paste (show other bugs)
Version: master
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-11 20:31 UTC by Martin Sandsmark
Modified: 2022-11-16 09:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Sandsmark 2022-06-11 20:31:30 UTC
Happens very randomly, but sometimes when I select something it gets cut off after column 81.

Example full line:
>   1051253:     calling init: /usr/lib/qt/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so [0]

Gets cut to:
>    1051253:     calling fini: /usr/lib/qt/plugins/platforminputcontexts/libcompos

And if I try to select something that is cut off (e. g. "inputcontext") nothing gets put in the selection buffer/clipboard.

The default number of columns is 80, and it is reset to that some places in the code, but it's hard to reproduce so I can't change the various default values to see where it stems from.

It's pretty low severity since it goes away for a bit if I click around a bit (but then randomly returns when I try to copy the same line again later), but it is very odd so I thought I'd file a bug.
Comment 1 Martin Sandsmark 2022-06-11 20:36:17 UTC
CCing in Luis, who semi-recently had a commit related to extension of selection to end columns, just in case you have any idea.
Comment 2 Martin Sandsmark 2022-06-12 14:37:13 UTC
Even weirder, it seems to be influenced by what I previously selected. If I select from the start of the line until some arbitrary length, deselect by clicking somewhere, and then attempt to select again it will copy a different part to the clipboard.

I'll try reverting the selection commits and run with it for a while to see if it still happens.
Comment 3 Martin Sandsmark 2022-06-12 14:49:59 UTC
In case I forget to update the bug because it just works, here are the commits I'm testing with reverting:
> e8f771018079d0293db602e3e1e77f1f5f27ba6f: "Do not count trailing empty cells on selections"
> e4cbfef2b5a18337b6ae787db2cc253df721e7e6: "Allow ending wordwise select in mousetracking mode"
> 4e69f47b06c7c867e17465f4d68c1021a877925d: "Respect Trim Trailing Space also in history buffer"
> 9046680f5a03234b395c500354cfad005adbefa6: "Ignore non-real chars for selection in history"
> 836b1d981485717d1cb6738ef0a901c3600d4742: "Selecting past last char -> extend to last column"
> 4e0bcd4edbf405988282e8264d51376b3ab45e10: "Set default rendition before clearing the screen"

I might have missed some, but these are after 34000dfa1e8b4a6ae4483975ef812544f098059c (which was the previous version I was using and I didn't have the issue) and mentioned selection.
Comment 4 Bug Janitor Service 2022-11-10 00:58:07 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/770
Comment 5 Kurt Hindenburg 2022-11-10 16:55:02 UTC
Git commit f01fdd0a55726e60f068e72573d0323129a10eb1 by Kurt Hindenburg, on behalf of Luis Javier Merino Morán.
Committed on 10/11/2022 at 16:35.
Pushed by hindenburg into branch 'master'.

Fix trimmed selections in scrollback buffer

Commits 4e69f47b and 9046680f where using an incorrect start of buffer
when trimming trailing spaces and trailing empty cells in a line from
the scrollback buffer.  This could cause too short of a text to be
copied from the selection when there were trailing spaces in the
selection.
Related: bug 461542

M  +2    -2    src/Screen.cpp

https://invent.kde.org/utilities/konsole/commit/f01fdd0a55726e60f068e72573d0323129a10eb1