warp icon indicating copy to clipboard operation
warp copied to clipboard

Global hotkey working inconsistently (linux)

Open DennisHakvoort opened this issue 2 years ago • 18 comments

Discord username (optional)

No response

Describe the bug

I've set the global hotkey to F12. When I press this button on an empty dekstop or in an application that doesn't use this hotkey themselves, the keypress goes to that application instead. For example, it would open firefox's developer settings instead of the terminal.

To reproduce

Set the global hotkey to F12 -> confirm it's working -> go to firefox -> press F12

Expected behavior

Warp opens

Screenshots

No response

Operating system

Linux

Operating system and version

Ubuntu 23.10

Shell Version

zsh 5.9 (x86_64-ubuntu-linux-gnu)

Current Warp version

v0.2024.02.20.08.01.stable_01

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

Might be related to the way ubuntu handles hotkeys. Other project have ran into this issue as well. See https://github.com/Guake/guake/issues/1012.

A common workaround is to make a global shortcut through the system settings to call a command that toggles the terminal. If a command like such exists for warp (i.e. warp-terminal toggle), it would be a solid workaround for users encountering this issue.

Does this block you from using Warp daily?

No

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

DennisHakvoort avatar Feb 23 '24 12:02 DennisHakvoort

I have this issue as well on Fedora KDE Spin running on Wayland. In addition, when it does appear, it does not become the active window. You have to first click on it to be able to type.

What I'm expecting is something like in Yakuake terminal -- it becomes the active window the moment it appears, and upon disappearing (pressing the hotkey again), the previous window is restored as the active one.

rmarfil3 avatar Feb 25 '24 07:02 rmarfil3

Hey @rmarfil3,

I created a kwinscript that replaces the hotkey. It opens warp on whatever monitor your mouse cursor is on (if you have multiple monitors) And it just keeps the size and position on the screen that you have it set to. The focus jumps to Warp, and then back to the previous application when toggling it.

https://drive.google.com/file/d/1t-e4Whfx3mDK59Dpzi8EF7JnbpoIRVTX/view

If you're unfamiliar with installing them then here's a quick guide :) image

And if you want to check the code before installing it, just rename it to .zip and extract it. It's just javascript inside.

Once you install it, it will automatically bind to F9 but you can change that in settings image

hailwood avatar Feb 26 '24 00:02 hailwood

Hey @hailwood, I just tried your Kwin script and it works flawlessly! Thanks a lot for this! I'm still evaluating Warp if it's worth switching over to it and this really helps!

rmarfil3 avatar Feb 26 '24 06:02 rmarfil3

Thank you, the kwin script works perfectly for me too. I'm also a yakuake user and evaluating Warp. Your script actually works better than Yakuake does for multiple monitors (https://bugs.kde.org/show_bug.cgi?id=383555)!

rocketraman avatar Mar 01 '24 14:03 rocketraman

Thank you! I'm also on Fedora KDE Spin and that script works perfectly.

chuckbenger avatar Mar 09 '24 22:03 chuckbenger

I use a grid of virtual desktops, so I'm complementing this great KWin script (thanks a ton, @hailwood!) with a window rule that ensures Warp pops at the VD I´m in:

Spectacle-Screenshot_20240414_111845

cig0 avatar Apr 14 '24 14:04 cig0

Hey all, Warp has changed the window name, so we've got an updated version of the kwin script.

  • Download it from below
  • Remove the .zip extension (needed the extension so github would let me upload it)
  • Reinstall it
  • Celebrate 🎉

toggler.warp.hailwood.nz.kwinscript - v1.1

Or you can manually edit ~/.local/share/kwin/scripts/toggler.warp.hailwood.nz/contents/code/main.js line 2 to read

  let client = workspace.clientList().find(c => c.resourceName === 'warp');

@cig0 you'll want to do warp dev.warp.warp for your window class now I believe.

hailwood avatar Apr 18 '24 22:04 hailwood

Hey all, Warp has changed the window name, so we've got an updated version of the kwin script.

* Download it from below

* Remove the .zip extension (needed the extension so github would let me upload it)

* Reinstall it

* Celebrate 🎉

toggler.warp.hailwood.nz.kwinscript - v1.1

Or you can manually edit ~/.local/share/kwin/scripts/toggler.warp.hailwood.nz/contents/code/main.js line 2 to read

  let client = workspace.clientList().find(c => c.resourceName === 'warp');

@cig0 you'll want to do warp dev.warp.warp for your window class now I believe.

Thanks for the swift update; I think my heart skipped a beat today when I noted the keybinding wasn't working anymore after upgrading Warp :sweat: :pray:

About the window class property (thanks for the reminder, too), it's strange that even though I updated everything accordingly, some properties work as they used to, and others stop working.

For example

  • The Warp window is now bound to only one virtual desktop (whichever one you select or launch the application) instead of popping up on all the VD you might have selected.
  • The Maximize properties stopped working altogether.
  • All the Skip properties (taskbar, switcher, pager) also stopped working.

Maybe I can force the behavior I want by extending your script. I think it's worth the shot. It is also a wonderful opportunity to get started with KWin scripting!

In any case, we desperately need this global hotkey fix landing soon!

cig0 avatar Apr 19 '24 01:04 cig0

Heads up: after upgrading to v0.2024.04.16.08.02.stable_03, I had to update main.js resourceName to dev.warp.warp for KWin to correctly identify the window.

HTH ^_^

cig0 avatar Apr 24 '24 00:04 cig0

Heads up: after upgrading to v0.2024.04.16.08.02.stable_03, I had to update main.js resourceName to dev.warp.warp for KWin to correctly identify the window.

HTH ^_^

Ah yes, I guess they realised they broke stuff so changed it back.

I've now changed it to

.find(window => window.resourceName.toLowerCase().split('.').pop() === 'warp')

So no matter what they do, as long as it ends in warp as the last (or only) word the script will keep working.

  • Download the update from below
  • Remove the .zip extension (needed the extension so github would let me upload it)
  • Reinstall it
  • Celebrate 🎉

toggler.warp.hailwood.nz.kwinscript - v1.2

Thanks for the heads up!

hailwood avatar Apr 24 '24 01:04 hailwood

For gnome users who stumbled here, you can use the Quake Terminal extension instead of Warp's global hotkey functionality. You can set it to launch Warp and specify the keybind similar to how you would with Warp. It works much smoother IMO (specially on wayland).

KhaledSakr avatar Sep 18 '24 14:09 KhaledSakr

I just spent an hour trying to downgrade to X11 from Wayland, because I guess I upgraded recently to Gnome 49, which removed X11 support, and so had some oddities with my custom shortcut to launch Warp with the global hotkey. Turns out it works fine if Warp is already in focus. And the issue is because now Wayland doesn't let apps just listen for hotkeys, and they have to be registered with Mutter (I think). I suppose I'll look at this KDE script as a last resort. Maybe convert it to Gnome.

ElijahLynn avatar Nov 01 '25 23:11 ElijahLynn

So after vibe coding on this a bit, I accidentally noticed that my shortcut ctrl + shift + t does work globally while using my Cursor IDE..

The hypothesis that Cursor came up with was this:

Why Ctrl+Shift+T works in Cursor

Main reasons

Electron/XWayland compatibility

  1. Cursor runs on Electron and often uses XWayland
  2. XWayland provides X11-style keyboard grabbing that’s more permissive than pure Wayland
  3. Native Wayland apps (like Warp) have stricter restrictions

Application-level handling

  1. When Cursor has focus, it handles keyboard events directly
  2. This is application-level behavior, not a global shortcut
  3. Similar to Warp’s shortcuts working when Warp has focus

VS Code’s keyboard system

  1. Based on VS Code, which has more mature shortcut handling
  2. Can use Electron’s globalShortcut API with better compatibility

ElijahLynn avatar Nov 01 '25 23:11 ElijahLynn

Still broken today. Does anyone use a global hotkey consistently with Wayland?

This is so frustrating to use Warp without a global hotkey that works.

ElijahLynn avatar Feb 14 '26 15:02 ElijahLynn

More explanation from @acarl005 on why it works only sometimes:

  • https://github.com/warpdotdev/Warp/issues/4800#issuecomment-2070848223

ElijahLynn avatar Feb 15 '26 16:02 ElijahLynn

also, in

More explanation from @acarl005 on why it works only sometimes:

Also, from the above comment I discovered there is a new "use wayland for window management" setting, and once enabled and warp is restarted then the global hot key setting shows that it is not supported anymore with a link to docs at https://docs.warp.dev/terminal/windows/global-hotkey (which mention nothing about Wayland fwiw).

My setting was initially unchecked as I was on x11 for as long as I could me before stuff just started breaking too much which forced me onto Wayland (which is also broken in inconvenient ways, such as breaking shortcuts for copyq, flameshot and warp).

Image Image

ElijahLynn avatar Feb 15 '26 16:02 ElijahLynn

fwiw, copyq (on wayland) seems to have possibly solved this like this:

Image

Then once you hit "apply", it shows this dialog saying need to restart.

Image

Then have to properly quit the application and manually reopen (would be nicer have a restart button).

Then once reopening, appears to open a system dialog adding a shortcut for copyq. Worth noting that this shortcut does NOT show up in the custom shortcuts system setting and I do not know where it is after the fact.

Image

Copyq is opensource (wish Warp was too) so Warp engineers can checkout the implementation details themselves.

Copyq docs on this are here, but don't mention wayland etc. https://copyq.readthedocs.io/en/latest/keyboard.html#create-new-shortcut

ElijahLynn avatar Feb 15 '26 16:02 ElijahLynn

I cloned https://github.com/hluk/CopyQ and asked Warp:

/agent find all commits that worked on the global shortcut to show hide main window, adding proper wayland support

and it gave me these commits:

Based on my search, here are the key commits that worked on global shortcuts for showing/hiding the main window with proper Wayland support:

Primary Wayland Support Commits

808a0615 - Wayland: Register global shortcuts using Portal (Sep 13, 2025)
•  Major implementation adding Portal support for global shortcuts on Wayland
•  Modified 9 files with 543 insertions
•  Key files: qxt/qxtglobalshortcut_x11.cpp, src/app/clipboardserver.cpp

06e1b218 - Linux: Register global shortcuts using Portal (Sep 13, 2025)  
•  Foundation work for Portal-based global shortcuts
•  Modified 4 files with 227 insertions
•  Key files: src/app/clipboardserver.cpp, src/gui/shortcutswidget.cpp

cf4acd2e - X11: Use Portal optionally with COPYQ_USE_PORTAL env variable (Dec 17, 2025)
•  Made Portal usage optional via environment variable
•  Modified qxt/qxtglobalshortcut_x11.cpp

Supporting Fixes

cdf827ca - X11: Fix registering global shortcuts with modifiers (Sep 29, 2025)
•  Fixed issue #3212 with modifier keys

d0a75768 - Tests: Add tests for global shortcuts in X11 (Sep 29, 2025)
•  Added testing infrastructure for global shortcuts

5de590bc - Use QKeySequenceEdit to handle setting shortcuts (Sep 29, 2022)
•  Fixed setting certain shortcuts like "Shift+Alt+2" on Wayland

33117ccc - X11: Fix toggle main window on global shortcut (Aug 5, 2018)
•  Fixed main window toggling behavior with global shortcuts

Looks like the main PR that got this working with the above screenshots is this one on 2025-09-14 - https://github.com/hluk/CopyQ/pull/3168 (https://github.com/hluk/CopyQ/commit/808a0615).

ElijahLynn avatar Feb 15 '26 17:02 ElijahLynn