Switching Sway workspaces causes VT switch on FreeBSD

Message ID
DKIM signature
Download raw message
Patch: +1 -2
Regressed by https://git.sr.ht/~kennylevinsen/seatd/commit/4ad48cb305b3

After upgrading seatd no longer requires pressing extra modifier to distinguish VT switch from a common keybinding to switch workspace. For example, in ~/.sway/config

  bindsym Mod4+F2 workspace number 2

switches VT to /dev/ttyv1 because my keymap(5) overlaps in non-graphics mode

  #                                                         alt
  # scan                       cntrl          alt    alt   cntrl lock
  # code  base   shift  cntrl  shift  alt    shift  cntrl  shift state
  # ------------------------------------------------------------------
    060   fkey02 fkey14 fkey26 fkey38 scr02  scr12  scr02  scr12   O   # F2
    105   lalt   lalt   lalt   lalt   lalt   lalt   lalt   lalt    O   # LWin

To restore the old behavior I had to partially revert that commit.

diff --git common/terminal.c common/terminal.c
index 183c9bd..fa220a2 100644
--- common/terminal.c
@@ -244,13 +244,12 @@ int terminal_ack_acquire(int fd) {

int terminal_set_keyboard(int fd, bool enable) {
	log_debugf("Setting KD keyboard state to %d", enable);
#if defined(__linux__) || defined(__NetBSD__)
	if (ioctl(fd, KDSKBMODE, enable ? K_ENABLE : K_DISABLE) == -1) {
		log_errorf("Could not set KD keyboard mode to %s: %s",
			   enable ? "enabled" : "disabled", strerror(errno));
		return -1;
#elif defined(__FreeBSD__)
#if defined(__FreeBSD__)
	struct termios tios;
	if (tcgetattr(fd, &tios) == -1) {
		log_errorf("Could not set get terminal mode: %s", strerror(errno));
Message ID
<ilrx-7bf2-wny@FreeBSD.org> (view parent)
DKIM signature
Download raw message
Ah, indeed the NetBSD implementation messed up keyboard handling on 
FreeBSD. Nice find!

I applied the fix to master, sorry for the inconvenience.
Reply to thread Export thread (mbox)