Page MenuHomeFreeBSD

vt: Fix contents of paste buffer for newcons.
ClosedPublic

Authored by hselasky on Jun 22 2022, 4:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 9:46 PM
Unknown Object (File)
Sun, Oct 27, 10:56 PM
Unknown Object (File)
Sun, Oct 27, 9:44 PM
Unknown Object (File)
Fri, Oct 25, 9:37 PM
Unknown Object (File)
Fri, Oct 25, 3:05 PM
Unknown Object (File)
Oct 9 2024, 10:10 AM
Unknown Object (File)
Oct 6 2024, 6:19 AM
Unknown Object (File)
Oct 4 2024, 2:50 PM

Details

Summary

Trim all whitespace from end of line, except for last line and
only use '\r' to terminate the pasted lines as expected by TTY.

Submitted by: Ivan Quitschal <tezeka@hotmail.com>
MFC after: 1 week
Sponsored by: NVIDIA Networking

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Make sure to zero-fill the remainder of the paste buffer, which will be skipped during paste.

Use TCHAR_CHARACTER() to detect whitespace.

Pointed out by: Tomoaki AOKI

Fix some bugs.

  1. TTY converts \r to \n and \n to \0 , so only emit \r for newline.
  2. Use TCHAR macro when checking for NUL character.

Keep trailing space on last line.

Keep trailing space on last line.

Worked "almost" as expected.

*No unneeded '\0' pasted.
*Proper newline.
*Pasted wanted last-line trailing space.
*But unfortunately, IDEOGRAPHIC (Full-width) SPACE (E38080,  U+3000) seems to be treated
 as regular character, not as space.

Anyway, thanks in advance!

Updated patch with support for more unicode word separators.

Patches will be split before commit.

This revision is now accepted and ready to land.Jun 25 2022, 9:30 AM

Include all chunks.

Thanks!
Tested and worked just as intended.

*Trailing spaces only listed in switch() of tchar_is_word_separator() are deleted on non-last lines.
*Space (tried U+3000 only, though) before U+2007, which is not listed and untouched, on non-last line is sanely kept.

If any others having objection to handled spaces pop in, only the switch() part is needed to be re-considererd.
Right?