gnome-terminator / terminator

multiple GNOME terminals in one window
https://gnome-terminator.org
GNU General Public License v2.0
2.02k stars 253 forks source link

hide_window key on GNOME >=40 doesn't work #427

Open Darkproduct opened 3 years ago

Darkproduct commented 3 years ago

I recently started to use arch Linux with gnome 40 and transferred my terminator config from Ubuntu to arch.

The keybindings where the first thing I had to fix. Instead to <Strg> in arch you have to use <Ctrl> for some reason and if I edit the config inside the preferences window, terminator will still save the not working <Strg>.

But that's not the end of the world, that really annoys me is the not working hide_window. I usually use the Insert-Key, but every other combination, like <Ctrl>j, doesn't work either.

All the information:

❯ neofetch
                   -`                    swt@swtarch 
                  .o+`                   ----------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: VMware7,1 None 
               `+oooooo:                 Kernel: 5.11.14-arch1-1 
               -+oooooo+:                Uptime: 36 secs 
             `/:-:++oooo+:               Packages: 760 (pacman) 
            `/++++/+++++++:              Shell: zsh 5.8 
           `/++++++++++++++:             Resolution: preferred 
          `/+++ooooooooooooo/`           DE: GNOME 40.0 
         ./ooosssso++osssssso+`          WM: Mutter 
        .oossssso-````/ossssss+`         WM Theme: Adwaita 
       -osssssso.      :ssssssso.        Theme: Adwaita [GTK2/3] 
      :osssssss/        osssso+++.       Icons: Adwaita [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: terminator 
   `/ossssso+/:-        -:/+osssso+-     CPU: AMD Ryzen 5 5600X (6) @ 3.699GHz 
  `+sso+:-`                 `.-/+oso:    GPU: 00:0f.0 VMware SVGA II Adapter 
 `++:.                           `-/+/   Memory: 1040MiB / 7922MiB 
 .`                                 `/

❯ showkey -a

Press any keys - Ctrl-D will terminate this program

^[[2~    27 0033 0x1b
     91 0133 0x5b
     50 0062 0x32
    126 0176 0x7e
^D    4 0004 0x04

❯ cat .config/terminator/config
[global_config]
  window_state = fullscreen
  always_on_top = True
[keybindings]
  split_horiz = <Ctrl>h
  split_vert = <Ctrl>v
  hide_window = Insert
  group_all = <Ctrl><Shift><Alt><Super>p
  group_all_toggle = <Super>g
[profiles]
  [[default]]
    background_darkness = 0.65
    background_type = transparent
    cursor_color = "#aaaaaa"
    scrollback_lines = 8000
  [[sw]]
    cursor_color = "#aaaaaa"
    palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
  [[ws]]
    background_color = "#ffffff"
    cursor_color = "#aaaaaa"
    foreground_color = "#000000"
[layouts]
  [[default]]
    [[[window0]]]
      type = Window
      parent = ""
    [[[child1]]]
      type = Terminal
      parent = window0
[plugins]
mattrose commented 3 years ago

Thanks, I'll take a look at this. I think you're right about hide_window, I'll look into it when I have some time

mattrose commented 3 years ago

hmm, could this be it?

        if self.config['keybindings']['hide_window'] != None:
            if display_manager() == 'X11':

Are you running X11 or Wayland?

mattrose commented 3 years ago

We've had trouble with global keybindings on Wayland in the past, so that's why that code is there, but I wonder what will happen if we remove it.

Darkproduct commented 3 years ago

I'm on Wayland. If you want me to test something on my system, just send it.

mattrose commented 3 years ago

Weird, it doesn't work on GNOME 40 on my system either. It looks to me like the hide_window keypress doesn't seem to call the on_hide_window() function. I'm still trying to figure out why not.

mattrose commented 2 years ago

initial debug is in https://github.com/mattrose/terminator/tree/hide_window_debug

TylerTemp commented 2 years ago

Hi,

Im on Wayland too and just hit this issue. Look like in the code it just ignore if it's on Wayland.

I did some googling and find out that Wayland sucks at global hotkeys...

And looks like the way to add global hotkey in Wayland is to config in desktop tweak, like GNOME.

Cloud you please allow a cli tool to toggle the hide_window function, so we can config it ourself in desktop hotkey config. e.g:

/path/to/terminator --hide_window to toggle the window?

I've tried the code, and bind it (through desktop config) to self.hide/self.iconify works fine, but I'm unable to bring it back by self.deiconify()/self.show()/self.present()

I'm really hoping that this can be functional, even with some workaround, as my work is heavily on terminal, and terminator is the only terminal I'd like to use, because of this function.

Thanks in advance!

Ubuntu: 21.04 Gnome: 3.38.5 Wayland: Dont know how to check... terminator: 2.1.0

mattrose commented 2 years ago

That is an interesting solution. The trick is storing which window to unhide and sending the signal to that window. I have some ideas...

TylerTemp commented 2 years ago

Hi,

Im on Wayland too and just hit this issue. Look like in the code it just ignore if it's on Wayland.

I did some googling and find out that Wayland sucks at global hotkeys...

And looks like the way to add global hotkey in Wayland is to config in desktop tweak, like GNOME.

Cloud you please allow a cli tool to toggle the hide_window function, so we can config it ourself in desktop hotkey config. e.g:

/path/to/terminator --hide_window to toggle the window?

I've tried the code, and bind it (through desktop config) to self.hide/self.iconify works fine, but I'm unable to bring it back by self.deiconify()/self.show()/self.present()

I'm really hoping that this can be functional, even with some workaround, as my work is heavily on terminal, and terminator is the only terminal I'd like to use, because of this function.

Thanks in advance!

Ubuntu: 21.04 Gnome: 3.38.5 Wayland: Dont know how to check... terminator: 2.1.0

I just realized that it can switch back to XOrg by simply uncomment WaylandEnable=false under [deamon] section in file /etc/gdm3/custom.conf

By using x-org I can finally use terminator with hotkey, and it even automaticlly fixed the copy/paste bug... Yeah just use Xorg for a much more wholesome Linux experience (

And, hope this helps ppl who is under the torture of un-ready linux program like wayland and, yes, gnome, and nautilus, which constantly removing features that I uses daily for "a better user experience".

-- edit --

and this also "fixes" the fcitx Chinese input issues. Thanks, Wayland.

eric-burel commented 1 year ago

Related Stack Overflow question for Guake: https://askubuntu.com/questions/1406716/function-keys-not-working-at-desktop-on-ubuntu-22-04 The CLI trick is also recommended there.

eric-burel commented 1 year ago

That is an interesting solution. The trick is storing which window to unhide and sending the signal to that window. I have some ideas...

You mean when having multiple Terminator windows? Just for the record it's probably common to have only one Terminator instance for users relying heavily on this shortcut like me, because we often come from Guake which favours this workflow. So evne if its buggy with multiple windows you'd save our life if supporting this feature for at least one window.

Darkproduct commented 1 year ago

Just found out that is doesn't work on Ubuntu 22.04 LTS as well :(

❯ neofetch 
            .-/+oossssoo+/-.               systemtest@systemtest-carts-vm 
        `:+ssssssssssssssssss+:`           ------------------------------ 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 22.04.1 LTS x86_64 
    .ossssssssssssssssssdMMMNysssso.       Host: VMware Virtual Platform None 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 5.15.0-57-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 9 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 1733 (dpkg), 11 (snap) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: bash 5.1.16 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 1918x1059 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   DE: GNOME 42.5 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: Mutter 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   WM Theme: Adwaita 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Theme: Yaru [GTK2/3] 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Icons: Yaru [GTK2/3] 
  +sssssssssdmydMMMMMMMMddddyssssssss+     Terminal: x-terminal-emul 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      CPU: Intel i5-4570 (2) @ 3.192GHz 
    .ossssssssssssssssssdMMMNysssso.       GPU: 00:0f.0 VMware SVGA II Adapter 
      -+sssssssssssssssssyyyssss+-         Memory: 1141MiB / 7915MiB 
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.                                       
Darkproduct commented 1 year ago

For now, I'll stop using window_state = fullscreen and use <super>+h to hide the window and old school <alt>+<tab> to get it back. But I don't know how long I can live like this.

tadayosi commented 1 year ago

I struggled with the same problem but right now switching from Wayland to Xorg is the easiest workaround. Among others, this issue is the main reason I still cannot migrate to Wayland.

Kostanos commented 1 year ago

CLI already has a parameter

  --unhide              If Terminator is already running, just unhide all
                        hidden windows

Would be great if it will do a "toggle hide/unhide" instead Personally I never run more than one terminator instance, so will work in my case.

vmath3us commented 1 year ago

improvement: hide/unhide on profile example terminator -p profile1 --unhide, to open, if no exists, new window on specific profile, or toggle hide

j-d-r commented 11 months ago

Hello, I suggest to add --toggle-visibility in PR https://github.com/gnome-terminator/terminator/pull/797 and bind it in window manager.

protist commented 1 week ago

It looks like this has been fixed using terminator --toggle-visibility. Thanks for that. However, this seems quite a lot slower than the "old" X11 version. It takes ~0.5 second to hide or show the window. Doesn't sounds like much, but given how much I use the terminal it feels extremely sluggish. Is there a way to speed it up?

EDIT I've tested this on another system of mine that still runs X11. It looks like this delay is not related to Wayland, but instead related to terminator's implementation itself. When I use the "old" integrated hide_window keybind, it takes <0.1 seconds to show/hide. When I use terminator --toggle-visibility, it takes ~0.5 seconds even in X11.