Stunkymonkey / nautilus-open-any-terminal

GNU General Public License v3.0
602 stars 63 forks source link

Opened new tabs in existing terminal no longer makes the terminal grab focus (focus stays in nautilus) #189

Open arigit opened 2 months ago

arigit commented 2 months ago

Since I upgraded my desktop to Ubuntu 24.01.1 (LTS) / GNOME 46 and switched to a Wayland desktop, nautitlus-open-any-terminal (latest master as of now) works but has a problem.

with this configuration:

image

right clicking on any script in nautilus and "Executing in Ptyxis" opens a new tab in the existing ptyxis window and runs the script however the Window focus remains in Nautilus. Before (on ubuntu 22.04 / X11 environment) the new tab always got the focus.

This is kind of annoying as I usually run interactive scripts this way. Can the same old behavior be implemented on modern wayland/gnome? (or: make the focus behavior configurable)

arigit commented 2 months ago

I tested with two different terminals, ptyxis (flatpak) and tilix (deb package), both have the same problem, the new tabs do not grab the focus.

I tried to test with gnome-terminal as well but the "new tab" functionality of nautilus-open-any-terminal does not work with it for some reason.

arigit commented 2 months ago

Hi, I tested with various different terminal apps, in X11 it works, the new tab is created in the terminal, and focus shifts from nautilus to the terminal app / new tab.

In Wayland, the new tab is created and the command runs in it but focus gets stuck in nautilus, no matter what terminal app you are using. This is not a terminal app setting I believe, at least I couldn't find one. There must be a way to tell Wayland to move the focus to the terminal window.

This app (gnome shell extension) is able to raise specific windows if they exist and set focus to them, or create new ones and set the focus, and works perfectly on both Wayland and X11, so somehow this is doable in wayland: https://github.com/CZ-NIC/run-or-raise

arigit commented 2 months ago

See here how they set the focus to the gnome-shell window they want:

https://github.com/CZ-NIC/run-or-raise/blob/main/lib/action.js

it's in javascript though