HomeFreeBSD

vt: restore tty when console is ungrabbed

Description

vt: restore tty when console is ungrabbed

When a break-to-debugger is triggered, kdb will grab the console and vt(4)
will generally switch back to ttyv0. If one issues a continue from the
debugger, then kdb will ungrab the console and the system rolls on.

This change adds a perhaps minor feature: when we're down to grab == 0 and
if vt actually switched away to ttyv0, switch back to the tty it was
previously on before the console was grabbed.

The justification behind this is that a typical flow is to work in
!ttyv0 to avoid console spam while occasionally dropping to ddb to inspect
system state before returning. This could easily enough be tossed behind
a sysctl or something if it's not generally appreciated, but I anticipate
indifference.

Reviewed by: ray
Differential Revision: https://reviews.freebsd.org/D27110

Details

Provenance
kevansAuthored on Dec 31 2020, 4:50 PM
Reviewer
ray
Differential Revision
D27110: vt: fix window switching w.r.t. cngrab/cnungrab
Parents
rGbe4663433724: vt: more carefully handle vt_allocate_keyboard grab work
Branches
Unknown
Tags
Unknown