From 998a43455baa189a106c6e034626a46615e2ea64 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 9 Oct 2012 13:10:02 +0200 Subject: [PATCH] uterm: vt: reset KBMODE to K_UNICODE if it was K_OFF 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 --- src/uterm_vt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/uterm_vt.c b/src/uterm_vt.c index 53e91df..433c6be 100644 --- a/src/uterm_vt.c +++ b/src/uterm_vt.c @@ -330,6 +330,12 @@ static int real_open(struct uterm_vt *vt, const char *vt_for_seat0) 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); -- 2.7.4