The problem is that ioctl calls to switch tty require root. sway seems to do it using the wlc library.