alacritty / alacritty

A cross-platform, OpenGL terminal emulator.
https://alacritty.org
Apache License 2.0
55.54k stars 2.99k forks source link

xdotool fails to recognize alacritty window #7662

Open AdrienLemaire opened 7 months ago

AdrienLemaire commented 7 months ago

My keybind to resize windows fails with alacritty (works fine with other windows like chromium or slack). When debugging the issue, I found out that xdtool fails to recognized the alacritty window.

$ xdotool getactivewindow
XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1)
xdo_get_active_window reported an error

Any idea why this this happening, how to debug it further and hopefully resolve it ?

For context, on ubuntu gnome, we have bindings like Super+Up to resize windows, but it only works on landscape screens and I have a portrait monitor. I wrote a script to handle resizing depending on the screen presentation mode. Without the script, ubuntu gnome (Mutter?)'s default keybinding worked fine with alacritty too.

System

OS: Linux 6.1.0-1028-oem Version: alacritty 0.12.3 (5efb0690) Linux/BSD: Ubuntu Gnome ~Wayland~ X11

Logs

alacritty -vv alacritty -vv Created log file at "/tmp/Alacritty-3037749.log" [0.000002137s] [INFO ] [alacritty] Welcome to Alacritty [0.000102851s] [INFO ] [alacritty] Version 0.12.3 (5efb0690) [0.000116928s] [INFO ] [alacritty] Running on X11 [0.000730447s] [INFO ] [alacritty] Configuration files loaded from: "/home/dori/.config/alacritty/alacritty.yml" [0.008475912s] [INFO ] [alacritty] Using GLX 1.4 [0.053266609s] [INFO ] [alacritty] Window scale factor: 1 [0.054761197s] [DEBUG] [alacritty] Loading "FiraCode Nerd Font Mono" font [0.066559863s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGH T, render_mode: "Normal", lcd_filter: 1 } [0.069271344s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 } [0.071936411s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 } [0.074651998s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: NO_BITMAP | TA RGET_LIGHT, render_mode: "Normal", lcd_filter: 1 } [0.080780253s] [INFO ] [alacritty] Running on Mesa Intel(R) Graphics (RPL-P) [0.080804365s] [INFO ] [alacritty] Using OpenGL 3.3 renderer [0.089304128s] [DEBUG] [alacritty] Filling glyph cache with common glyphs [0.100210411s] [INFO ] [alacritty] Cell size: 9 x 19 [0.100246472s] [INFO ] [alacritty] Padding: 0 x 0 [0.100255072s] [INFO ] [alacritty] Width: 800, Height: 600 [0.118426434s] [INFO ] [alacritty] PTY dimensions: 31 x 88 [0.121940126s] [INFO ] [alacritty] Initialisation complete [0.125610062s] [DEBUG] [alacritty_terminal] Term::resize dimensions unchanged [1.635964857s] [DEBUG] [alacritty_terminal] [unhandled osc_dispatch]: [['1'],['.''.''n''f''i''g''/''n''v'' i''m''/''l''u''a'],] at line 963 [1.646217160s] [DEBUG] [alacritty_terminal] [unhandled osc_dispatch]: [['7'],['f''i''l''e'':''/''/''d''o'' r''i''-''X''P''S''-''9''3''2''0''/''h''o''m''e''/''d''o''r''i''/''.''c''o''n''f''i''g''/''n''v''i''m''/''l ''u''a'],] at line 963 [1.823246945s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 } [3.317612266s] [INFO ] [alacritty] Goodbye Deleted log file at "/tmp/Alacritty-3037749.log"
chrisduerr commented 7 months ago

Linux/BSD: Ubuntu Gnome Wayland

You are not running Ubuntu Gnome Wayland unless you're running Alacritty through XWayland. Are you intentionally not using Wayland here?

AdrienLemaire commented 7 months ago
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

$ ps -e | grep gnome-session
1299675 tty2     00:00:00 gnome-session-b
1299736 ?        00:00:00 gnome-session-c
1299749 ?        00:00:02 gnome-session-b

$ echo $WAYLAND_DISPLAY
$ echo $DISPLAY
:0

You're right, I'm running X11. I thought Wayland was the default on ubuntu, but since the xps13 was pre-installed with ubuntu, maybe Dell set it up like this ? A bit worried that changing the display server now will break something else :sweat:

chrisduerr commented 7 months ago

A bit worried that changing the display server now will break something else 😓

I mean it certainly won't make xdotool work any better. Just something I thought you should be aware of.

iambeingtracked commented 7 months ago

+1, basically, try using xdotool key shift+Insert in alacritty 0.13.1 (fe2a3c56)

then downgrade to alacritty 0.12.2 (9d9982df) and do xdotool key shift+Insert again. (Make sure you still have the .yml configuration)

It will insert "^[[2~%" on 0.13.1, but it will insert what you copied on 0.12.2.

Not sure about the exact version that caused this issue, but it isn't there on the older version.

I also recorded a video demonstrating this but I'm a bit too ashamed of my accent so I won't send it :)

kchibisov commented 6 months ago

@iambeingtracked recognize and can't type is a different matter, your issue sounds like #7633.

BrendanMesters commented 1 month ago

@kchibisov issue #7633 seems to be closed, yet the issue with xdotool not recognizing alacrity windows still seems to persist.

At least, I myself am trying to find the window id with xdotool search --pid 123456 (123456 being the pid of a specific alacrity window) and it simply does not find it. If I try the same with xterm it does however work, and I am able to manipulate the xterm window in that way.

Just wanted to check that there wasn't a solution found which I missed, as I would love to setup a single "guake"-esque alacrity window (through a small script utilizing xdotool).

kchibisov commented 1 month ago

what will happen if you have more than one window under the same pid though? anyway, if things like xprop, etc work I'm not sure what could be the issue.