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)
Fri, Apr 5, 11:54 AM
Unknown Object (File)
Fri, Apr 5, 11:54 AM
Unknown Object (File)
Fri, Apr 5, 11:54 AM
Unknown Object (File)
Fri, Apr 5, 11:54 AM
Unknown Object (File)
Fri, Apr 5, 11:54 AM
Unknown Object (File)
Fri, Apr 5, 11:53 AM
Unknown Object (File)
Feb 11 2024, 1:37 PM
Unknown Object (File)
Feb 10 2024, 1:31 AM

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?