Skip to content

fix(launcher): drawer launches Terminal=true apps via xdg-terminal-exec#174

Open
ImIvanGil wants to merge 1 commit into
Axenide:mainfrom
ImIvanGil:fix/launcher-terminal-true-apps
Open

fix(launcher): drawer launches Terminal=true apps via xdg-terminal-exec#174
ImIvanGil wants to merge 1 commit into
Axenide:mainfrom
ImIvanGil:fix/launcher-terminal-true-apps

Conversation

@ImIvanGil
Copy link
Copy Markdown

Problem

The app drawer (SUPER keybind) silently fails to launch any .desktop entry that has Terminal=true — e.g. btop, htop, nvim, ranger, lazygit, etc. Clicking these does literally nothing: no error, no flash, no terminal window. The behavior is hard to debug because the failure is invisible.

Root cause

LauncherView.executeApp() (line 228) calls Quickshell's DesktopEntry.execute() directly:

if (app && app.execute) {
    app.execute();
}

Quickshell's DesktopEntry.execute() (at least in older / illogical-impulse-quickshell-git 0.2.0) does not wrap Terminal=true entries in a terminal emulator — it simply runs the Exec line, which causes the TUI binary to crash immediately when stdin/stdout aren't a TTY.

Meanwhile, DockAppButton.qml:184 already uses AppSearch.launchApp() for the same purpose, which handles process spawning correctly via bash -c "setsid ...". So the drawer was inconsistent with the dock.

Fix

Two minimal changes:

  1. LauncherView.qmlexecuteApp() now delegates to AppSearch.launchApp(app), matching the dock's behavior. Unifies app-launch logic across the shell.

  2. AppSearch.qmllaunchApp() now prepends xdg-terminal-exec to the command when the entry's runInTerminal is true. xdg-terminal-exec is the freedesktop default-terminal-spec wrapper — the canonical way to launch TUI apps from a desktop launcher.

Requirements for users

After this fix, users need to have xdg-terminal-exec installed (AUR on Arch, packaged on most modern distros) and configured via ~/.config/xdg-terminals.list:

kitty.desktop

(or alacritty.desktop, foot.desktop, etc.)

Worth mentioning in the README under "Requirements" — happy to add that in a follow-up if requested.

Testing

Reproduced the bug with:

  • btop (Console-only, Terminal=true)
  • htop (same)
  • nvim (Terminal=true)
  • ranger (Terminal=true)

Before this patch: silent failure for all four.
After this patch: each one opens correctly in kitty (the configured terminal via xdg-terminals.list).

GUI apps (Brave, Dolphin, etc.) continue to work unchanged — runInTerminal is false, the wrap branch is skipped, behavior is identical to before.

Diff stats

modules/services/AppSearch.qml            | 7 ++++++-
modules/widgets/launcher/LauncherView.qml | 9 ++++++---
2 files changed, 12 insertions(+), 4 deletions(-)

This is the first of a series of fixes I want to upstream from a longer debugging session on a CachyOS + Ambxst setup. Each subsequent fix will be its own PR to keep review focused. Happy to iterate based on feedback.

The app drawer (SUPER) used Quickshell's DesktopEntry.execute() directly,
which does not wrap commands of Terminal=true entries in a terminal
emulator. As a result, TUI apps like btop, htop, nvim, ranger, lazygit,
etc. silently failed to launch — clicking them did nothing visible
because the binary ran without a TTY and crashed immediately.

The dock (DockAppButton.qml) already used AppSearch.launchApp() for the
same purpose, so the drawer was inconsistent with the rest of the shell.

Two changes:
1. LauncherView.executeApp() now delegates to AppSearch.launchApp(),
   matching the dock and unifying app-launch behavior across modules.

2. AppSearch.launchApp() prepends `xdg-terminal-exec` when the entry's
   runInTerminal property is true. xdg-terminal-exec is the freedesktop
   default-terminal-spec wrapper and is the canonical way to launch
   TUI apps from a desktop launcher in 2025+.

Users must install xdg-terminal-exec (AUR / packaged in some distros)
and configure ~/.config/xdg-terminals.list with their preferred
terminal (e.g. `kitty.desktop` or `alacritty.desktop`).

Tested with: btop, htop, nvim, vim, ranger (all Terminal=true in their
.desktop files). Before: silent failure. After: opens in configured
terminal emulator.

Refs: freedesktop.org default-terminal-spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant