Page MenuHomeFreeBSD

vt(4): reset scrollback and cursor position after clearing history buffer
ClosedPublic

Authored by jah on May 30 2020, 9:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 7:21 PM
Unknown Object (File)
Oct 2 2024, 4:35 AM
Unknown Object (File)
Sep 25 2024, 10:29 PM
Unknown Object (File)
Sep 24 2024, 4:38 PM
Unknown Object (File)
Sep 24 2024, 4:38 PM
Unknown Object (File)
Sep 24 2024, 2:19 PM
Unknown Object (File)
Sep 22 2024, 6:12 PM
Unknown Object (File)
Sep 22 2024, 10:23 AM
Subscribers

Details

Summary

r361601 implemented basic support for cleaing the console history buffer.
But after clearing the history buffer, it's not especially useful to be
able to scroll back through that buffer, or for the cursor position to
remain at (very likely) the bottom of the screen.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31399
Build 29023: arc lint + arc unit

Event Timeline

jah requested review of this revision.May 30 2020, 9:29 PM
sys/kern/subr_terminal.c
494

This exposes a new issue: before, it was practically guaranteed that the cursor would be at the bottom of the screen, so the CLRHIST ioctl would be immediately followed by a scroll event that would invalidate the entire visible rect. Now that may no longer be the case: for example if you issue 'vidcontrol -C', then do a few things that don't fill the screen, then issue 'vidcontrol -C' again, some prior artifacts might still remain visible. Let me see if I can fix that...

Ensure the visible rect is invalidated on CONS_CLRHIST

emaste added inline comments.
sys/kern/subr_terminal.c
485

IMO it'd be fine to do if (cmd == CONS_CLRHIST) which neatly avoids the slightly confusing double } at the same indentation; we can deal with the awkwardness if we ever have a 2nd case to deal with. Yes, this is slightly inconsistent with the switch above.

This revision is now accepted and ready to land.May 31 2020, 12:48 AM

Light cleanup of cursor position handling

This revision now requires review to proceed.May 31 2020, 2:05 AM
jah marked an inline comment as done.May 31 2020, 2:06 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 2 2020, 1:22 AM
This revision was automatically updated to reflect the committed changes.