I found a discussion of this bug at https://askubuntu.com/questions/886593/alt-f4-switches-to-tty4 and a workaround (kbd_mode -s). No clue to what gets it in the wrong mode to begin with, though.
-- You received this bug notification because you are a member of Ubuntu-X, which is subscribed to xorg-server in Ubuntu. https://bugs.launchpad.net/bugs/1791493 Title: Unwanted VT switch from alt + arrow keys To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1791493/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~ubuntu-x-swat Post to : ubuntu-x-swat@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-x-swat More help : https://help.launchpad.net/ListHelp