controller: leave a usable terminal when stopping the desktop
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

Stopping the display manager left the Pi's monitor black with only a blinking
cursor. The console VT is already in the foreground with a getty and a live
shell on it (verified: /dev/vcs1 holds the login banner and prompt) — the
display manager just hands the display back without the console being
repainted, so nothing is visible.

Activate the console VT, then bounce off another VT to force a modeset and
redraw, and print a short message telling the user the Controller stopped the
desktop and how to start it again.

Best-effort throughout: skipped when no getty is on the console VT, a chvt or
console-write failure never fails the stop, and being stranded on the repaint
VT is reported rather than claimed as success. Verified on 10.0.0.8 hardware.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-07-29 15:54:18 -06:00
parent ab5f416b3f
commit a0fa03e6c5
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
6 changed files with 226 additions and 11 deletions

View file

@ -1577,8 +1577,8 @@
async function toggleDesktop() {
const btn = document.getElementById('desktop-btn');
if (desktopRunning && !confirm(
'Stop the desktop? Anyone using this WROLPi\'s own screen will lose their session.'
+ ' The desktop will return on the next reboot.')) {
'Stop the desktop? Anyone using this WROLPi\'s own screen will lose their session'
+ ' and the display will drop to a terminal. The desktop will return on the next reboot.')) {
return;
}
btn.disabled = true;