You are not logged in.

#1 2024-03-10 10:29:04

archer98
Member
Registered: 2024-03-10
Posts: 3

[Fixed] Ctrl+W unusable in X environment (but works in tty)

Hey folks,

using a laptop with i3wm I am not able to use <C-w> keybindings in (neo)vim, independently from the terminal emulator (default alacritty, tried xterm and gnome-terminal) and shell (zsh, bash). 

~ > xev -event keyboard:
KeyPress event, serial 28, synthetic NO, window 0x2c00001,
    root 0x3ff, subw 0x0, time 2033212, (638,696), root:(1602,724),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  255 0   0   0   32  0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

KeyRelease event, serial 28, synthetic NO, window 0x2c00001,
    root 0x3ff, subw 0x0, time 2033402, (638,696), root:(1602,724),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

~ > setxkbmap -query                                                                                   9s
rules:      evdev
model:      pc105
layout:     us

Pressing Ctrl+w in vim's insert mode doesn't yield any characters (but ctrl+s e.g. does yield "^S").
This behavior is only present within my X session, not in the tty my Arch boots up into (from which I type startx to start the X server). In my tty, I can use Ctrl+w key mappings in vim without problems.

Any idea folks?
Edit: fixed xev output

Last edited by archer98 (2024-03-10 10:59:48)

Offline

#2 2024-03-10 10:36:35

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,538

Re: [Fixed] Ctrl+W unusable in X environment (but works in tty)

According to the xev the server doesn't receive the "w" at all, it is either actively grabbed or no signal arrives at the server.
Does it show up in "sudo libinput debug-events" (press/press/release/release)?
Does it show up in xev in a "naked" session ("startx xterm")?

Offline

#3 2024-03-10 10:45:50

archer98
Member
Registered: 2024-03-10
Posts: 3

Re: [Fixed] Ctrl+W unusable in X environment (but works in tty)

thanks seth, seems I missed some relevant output from xev. Here is the revised version:

KeyPress event, serial 28, synthetic NO, window 0x2c00001,
    root 0x3ff, subw 0x0, time 2033212, (638,696), root:(1602,724),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  255 0   0   0   32  0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

KeyRelease event, serial 28, synthetic NO, window 0x2c00001,
    root 0x3ff, subw 0x0, time 2033402, (638,696), root:(1602,724),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Exactly, press/press/release/release pattern is present.
For me "startx xterm" simply starts another X/i3 session, I just started xterm there and and same behavior.

Offline

#4 2024-03-10 10:54:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,538

Re: [Fixed] Ctrl+W unusable in X environment (but works in tty)

That's a passive grab, ie. a global shortcut is assigned to the combo.

Run

sleep 5; xdotool key "XF86LogGrabInfo"

and press and hold ctrl+w until xdotool has fired.
The grabs will be printed into your xorg log, ctrl+w now being registered as "active" one and it should also reveal the PID/command of the client holding the grab (likely your WM)

Offline

#5 2024-03-10 10:59:33

archer98
Member
Registered: 2024-03-10
Posts: 3

Re: [Fixed] Ctrl+W unusable in X environment (but works in tty)

Fixed many thanks...there was some (custom) shortcut in my i3 config...

Offline

Board footer

Powered by FluxBB