Bug 260963

Summary: sc/vt console: mouse paste incorrectly adds newlines
Product: Base System Reporter: Stefan B. <sblachmann>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Many People CC: emaste, manu, sblachmann
Priority: ---    
Version: Unspecified   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261553
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263084

Description Stefan B. 2022-01-05 20:58:12 UTC
In the freebsd-hackers mailing list there was recently a discussion about bugs of vt.
At least another guy mentioned one of the most annoying vt bugs, so I think there is proof am not the only one who uses sc because of things like this issue:


Problem:
If one marks a line that goes across more than one screen line, vt *always* inserts a newline at each physical screen line end of the copy source.
This is highly annoying, as it is impossible to copy/paste in one piece, say, a command line.

Expected result:
The copied text gets pasted without newlines being inserted.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2022-01-06 20:17:45 UTC
> If one marks a line that goes across more than one screen line, vt *always*
> inserts a newline at each physical screen line end of the copy source.

I just booted an old image I had around (12.0-CURRENT r327524) in QEMU, and sc behaves the same way.

This would be good to address nonetheless.
Comment 2 Ed Maste freebsd_committer freebsd_triage 2022-01-06 20:25:46 UTC
I cannot find the referenced report on hackers - could you please add a link to the mailing list archive? I want to make sure I'm correctly trying to reproduce the differing behaviour between sc and vt.
Comment 3 Stefan B. 2022-01-18 15:51:23 UTC
The link:
https://lists.freebsd.org/archives/freebsd-hackers/2021-November/000498.html

I re-verified and notice that on 13, sc indeed adds newlines at EOL, which should not be done.
Maybe I confused this with x terminal emulators, which behave well in this regard.

Anyway I agree with you that it would make sense to adapt the console behavior so it resembles the behavior one is accustomed with X terminal emulators.