project-repo/cagebreak

Cannot change linux ttys

oblivikun opened this issue · 28 comments

when pressing ctrl+alt+f1-f6 i cannot switch to a diffirent tty like in other wayland compositors such as sway. i have tried manually adding the bindings in the cagebreak config but it does nothing

It works for me on Alpine with Cagebreak version 2.3.1. What distro are you running?

gentoo linux musl, wlroots compiled with vulkan,libinput,drm and x11 backend support

im running cagebreak 2.2.3

i should probably update cagebreak then check

still occurs on cagebreak 2.3.1

We have musl in common. My wlroots version is 0.17.3.

im running wlroots 0.17.2, il try updating it

I've actually been switching ttys with those keys a lot recently on my laptop, and it's fast. I'm doing it on my multi monitor desktop and it's a little slow to switch back and forth but it does work.

Well I should say on the desktop it's fast to switch to a different tty but then a bit slow for the Cagebreak session to reappear when I switch back to tty1. By slow though I only mean about 1-2 seconds.

still running into that issue

And sway works ok on the same hardware?

Did you back out those key bindings from your config?

yes, on sway i can change with the keys, but on cagebreak i have to manually call it with the chvt command

Weird. I'm on my laptop now and it's working fine, same component versions as my desktop.

it apears that it may be the C-A key combination that is not being recognized, as i can change ttys by binding L-[1,2,3] to exec sudo chvt (number)

keybinding_switch_vt(struct cg_server *server, unsigned int vt) {

There's a couple if's there, one of which might be false?

i removed that if statement and im still not able to switch ttys

I don't know if it matters, but I'm starting cagebreak from tty1 (no login manager) and in my .profile I have:

 exec dbus-run-session -- cagebreak -e > cagebreak.log 2>&1

im not running cagebreak with socket or dbus, will try that.

still no luck

I'm running out of ideas. Sway seems to use the same function to change vt:

https://github.com/swaywm/sway/blob/cc342107690631cf1ff003fed0b1cdb072491c63/sway/input/keyboard.c#L272-L276

But a difference in how the vt number is calculated... not really sure what that's doing.

evtest for me:

Event: time 1718399096.500469, -------------- SYN_REPORT ------------
Event: time 1718399097.643815, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1718399097.643815, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1718399097.643815, -------------- SYN_REPORT ------------
Event: time 1718399097.964859, type 4 (EV_MSC), code 4 (MSC_SCAN), value 38
Event: time 1718399097.964859, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 1
Event: time 1718399097.964859, -------------- SYN_REPORT ------------
Event: time 1718399098.181675, type 4 (EV_MSC), code 4 (MSC_SCAN), value 3c
Event: time 1718399098.181675, type 1 (EV_KEY), code 60 (KEY_F2), value 1
Event: time 1718399098.181675, -------------- SYN_REPORT ------------
Event: time 1718399098.323515, type 4 (EV_MSC), code 4 (MSC_SCAN), value 3c
Event: time 1718399098.323515, type 1 (EV_KEY), code 60 (KEY_F2), value 0

then i will copy what sway does

I guess I should have asked if you started with the example Cagebreak config? Mine has:

definekey top XF86_Switch_VT_1 switchvt 1
definekey top XF86_Switch_VT_2 switchvt 2
definekey top XF86_Switch_VT_3 switchvt 3
definekey top XF86_Switch_VT_4 switchvt 4
definekey top XF86_Switch_VT_5 switchvt 5
definekey top XF86_Switch_VT_6 switchvt 6

after applying the logic that sway did, it worked

Hmmm, and your non working config had the above default key bindings?

yes

Hi,
Sorry for the long response time. I have two questions that might help us figure out what's going on here:

  1. What does pressing ctrl+alt+fn+f1-6 do?
  2. You said that "applying the logic that sway did" makes it work. What do you mean by this exactly?

Cheers,
project-repo