If we switch to a VT that has KBMODE set to K_OFF, we do not set it back
to K_OFF when leaving, instead, we set it to K_UNICODE. This allows
recovering when kmscon died by simply restarting kmscon.
There is really no need to let a VT stay in K_OFF! This causes the user to
be stuck at this VT and use the sysrq (if enabled) keys to recover.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
goto err_setmode;
}
+ log_debug("previous VT KBMODE was %d", vt->real_kbmode);
+ if (vt->real_kbmode == K_OFF) {
+ log_warning("VT KBMODE was K_OFF, using K_UNICODE instead");
+ vt->real_kbmode = K_UNICODE;
+ }
+
ret = ioctl(vt->real_fd, KDSKBMODE, K_OFF);
if (ret) {
log_error("cannot set VT KBMODE to K_OFF (%d): %m", errno);