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)
Tue, Apr 16, 5:02 PM
Unknown Object (File)
Tue, Apr 16, 1:51 PM
Unknown Object (File)
Tue, Apr 16, 1:19 PM
Unknown Object (File)
Mar 7 2024, 5:43 PM
Unknown Object (File)
Feb 10 2024, 6:13 AM
Unknown Object (File)
Dec 31 2023, 2:00 PM
Unknown Object (File)
Dec 23 2023, 8:37 AM
Unknown Object (File)
Dec 20 2023, 2: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 31400
Build 29024: 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.