ghostty default terminal on ubuntu
on this page
tl;dr
Prerequisites: | Ghostty installed, Ubuntu with GNOME desktop |
Primary method: | gsettings set org.gnome.desktop.default-applications.terminal exec 'ghostty' |
Keyboard shortcut: | Ctrl+Alt+T will now open Ghostty |
System integration: | Applications requesting terminal will use Ghostty |
Verification: | gsettings get org.gnome.desktop.default-applications.terminal exec |
replace gnome-terminal with ghostty as the system default terminal emulator on ubuntu.
overview
ubuntu’s gnome desktop uses gnome-terminal as the default terminal emulator. replacing it with ghostty requires updating gnome’s default application settings and optionally configuring system-wide alternatives for complete integration.
this guide covers:
- gnome settings configuration for desktop integration
- system alternatives setup for command-line tools
- verification methods to confirm the change
- troubleshooting common issues
prerequisites
ensure ghostty is installed and accessible:
which ghostty
if not installed, follow the ubuntu build guide or install from official packages.
gnome desktop integration
update default terminal setting
the primary method uses gnome’s gsettings to configure the default terminal:
gsettings set org.gnome.desktop.default-applications.terminal exec 'ghostty'
this setting controls:
- ctrl+alt+t keyboard shortcut
- terminal launches from gnome shell activities
- application requests for terminal emulator
- right-click “open in terminal” from file manager
verify the change
confirm the setting was applied:
gsettings get org.gnome.desktop.default-applications.terminal exec
expected output: 'ghostty'
system alternatives (optional)
for complete system integration, update the alternatives system:
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/local/bin/ghostty 50
this ensures:
- command-line tools that call
x-terminal-emulator
use ghostty - system scripts request the correct terminal
- distribution packages integrate properly
check current alternatives
view available terminal emulators:
update-alternatives --display x-terminal-emulator
set ghostty as preferred
if multiple terminals are installed:
sudo update-alternatives --config x-terminal-emulator
select ghostty from the interactive menu.
immediate effects
changes take effect immediately:
- ctrl+alt+t opens ghostty
- gnome shell search launches ghostty for terminal queries
- file manager uses ghostty for “open in terminal”
- desktop shortcuts requesting terminal use ghostty
no logout or restart required.
verification methods
keyboard shortcut test
press ctrl+alt+t
- ghostty should open instead of gnome-terminal.
application integration test
open file manager (nautilus), right-click a folder, select “open in terminal” - ghostty should launch.
command-line test
from an existing terminal:
x-terminal-emulator --version 2>/dev/null || echo "using default terminal"
settings verification
check both settings:
# gnome setting
gsettings get org.gnome.desktop.default-applications.terminal exec
# system alternatives
update-alternatives --display x-terminal-emulator
reverting changes
restore gnome-terminal
revert to the original terminal:
gsettings set org.gnome.desktop.default-applications.terminal exec 'gnome-terminal'
remove system alternatives
remove ghostty from alternatives (if added):
sudo update-alternatives --remove x-terminal-emulator /usr/local/bin/ghostty
troubleshooting
ghostty not found
if ghostty installation path differs:
# find ghostty location
which ghostty
# update setting with correct path
gsettings set org.gnome.desktop.default-applications.terminal exec '/full/path/to/ghostty'
keyboard shortcut not working
check if custom keybindings override the default:
gsettings list-recursively | grep -i terminal
reset terminal shortcut:
gsettings reset org.gnome.settings-daemon.plugins.media-keys terminal
applications still use gnome-terminal
some applications hardcode gnome-terminal
. check if they support:
x-terminal-emulator
(standard alternative)$TERMINAL
environment variable- configuration options for custom terminal
file manager integration issues
ensure nautilus uses system defaults:
# reset file manager settings
gsettings reset org.gnome.nautilus.preferences default-terminal
wayland vs x11 considerations
ghostty works on both wayland and x11. if experiencing issues:
# check current session
echo $XDG_SESSION_TYPE
# force specific backend if needed
GDK_BACKEND=wayland ghostty
GDK_BACKEND=x11 ghostty
advanced configuration
per-user vs system-wide
the gsettings method affects only the current user. for system-wide defaults:
# create system schema override
sudo mkdir -p /etc/dconf/db/local.d
sudo tee /etc/dconf/db/local.d/00-terminal <<EOF
[org/gnome/desktop/default-applications/terminal]
exec='ghostty'
EOF
# update system database
sudo dconf update
environment variable method
set terminal preference via environment:
# in ~/.bashrc or ~/.profile
export TERMINAL=ghostty
# for current session
export TERMINAL=ghostty
desktop file integration
ensure ghostty has proper desktop integration:
# verify desktop file exists
ls -la /usr/share/applications/*ghostty* ~/.local/share/applications/*ghostty*
# update desktop database
update-desktop-database ~/.local/share/applications/
related configuration
after setting ghostty as default:
- customize ghostty using the configuration guide
- optimize performance with gtk single-instance mode
- configure themes for better integration with gnome
- set up keybindings that complement gnome shortcuts
resources
- ghostty configuration guide
- ghostty ubuntu build guide
- gnome desktop applications documentation
- update-alternatives documentation
- gsettings documentation
next steps
- verify ghostty is your default terminal with ctrl+alt+t
- customize ghostty configuration for optimal experience
- test integration with file manager and other applications
- optimize ghostty settings for your workflow
- explore advanced features like splits and shell integration