xdg-terminal-exec
Launch the user's preferred terminal emulator
TLDR
SYNOPSIS
xdg-terminal-exec [options] [--] [command [arguments ...]]
DESCRIPTION
xdg-terminal-exec launches the user's preferred terminal emulator, optionally with a command to execute inside it. It is the reference implementation of the proposed XDG Default Terminal Execution Specification from freedesktop.org.Candidate terminals are discovered from Desktop Entries installed on the system that declare the TerminalEmulator category and provide an X-TerminalArgExec key. The user chooses which of those entries to prefer by listing Desktop Entry IDs in a configuration file.This mirrors tools like xdg-open: instead of hard-coding a terminal in scripts, desktop launchers, or applications, callers invoke xdg-terminal-exec and the system resolves the user's choice at runtime.
PARAMETERS
--app-id=appid_
Set the Wayland app-id (or X11 class) of the spawned window.--title=title
Set the terminal window title.--dir=workdir
Change to workdir before running the command.--hold
Keep the terminal window open after the command terminates.--print-id
Print the Desktop Entry ID that was selected.--print-path
Print the filesystem path of the selected Desktop Entry.--print-content
Print the full content of the selected Desktop Entry.--print-cmd[=printfseq_]
Print the final command line that would be executed instead of running it.--print-delimiter=printfseq_
Set the delimiter used between multiple print outputs.--
Treat all following arguments as the command to execute.
CONFIGURATION
Preferred terminals are listed in the following files, searched in order of XDG config/data priority:
xdg-terminals.list
kitty.desktop
org.gnome.Terminal.desktop:new-window
ENVIRONMENT
XTE_CACHE_ENABLED
Enable or disable caching of the resolved terminal.XTE_DEBUG, DEBUG
Print debug information to stderr.XDG_CURRENT_DESKTOP, XDG_CONFIG_HOME, XDG_CONFIG_DIRS, XDG_DATA_DIRS
Standard XDG variables used for desktop detection and config lookup.
CAVEATS
The specification is still a proposal on the freedesktop.org terminal-wg tracker; backwards compatibility is maintained on a best-effort basis. Not every terminal emulator ships the X-TerminalArgExec key yet, so some installed terminals may be invisible to the selector until their Desktop Entry is patched.
HISTORY
xdg-terminal-exec was created by Vladimir Kudrya (Vladimir-csp) as a shell-based reference implementation accompanying a merge request against the freedesktop.org terminal-wg specifications repository. It is packaged by several distributions (Debian, Arch, Fedora) as a dependency of modern desktop launchers that need a generic way to spawn terminals.
SEE ALSO
xdg-open(1), xdg-mime(1), xdg-settings(1)
