### Install Solus Dependencies Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Installs the necessary development packages for building Ghostty on Solus. ```sh sudo eopkg install \ libgtk-4-devel \ libadwaita-devel \ pkgconf \ zig \ gettext ``` -------------------------------- ### Install Ghostty on Solus Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Install Ghostty on Solus using the `eopkg` package manager. ```sh eopkg install ghostty ``` -------------------------------- ### Install Ghostty on Void Linux Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Install Ghostty on Void Linux using the `xbps-install` command. ```sh xbps-install ghostty ``` -------------------------------- ### Install Gentoo Dependencies Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Installs the necessary packages for building Ghostty on Gentoo. ```sh emerge -av \ libadwaita \ gtk \ blueprint-compiler \ gettext ``` -------------------------------- ### Install Void Dependencies Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Installs the required development packages for building Ghostty on Void Linux. ```sh sudo xbps-install \ gtk4-devel \ gtk4-layer-shell-devel \ libadwaita-devel \ pkg-config \ zig \ gettext ``` -------------------------------- ### Install Ghostty on Ubuntu Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Installs Ghostty using a script from GitHub. Ensure you trust the source before running. ```sh /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/mkasberg/ghostty-ubuntu/HEAD/install.sh)" ``` -------------------------------- ### Install Ghostty via Snap Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Install Ghostty using the Snap package manager. The `--classic` flag is required. ```sh snap install ghostty --classic ``` -------------------------------- ### Install Fedora Dependencies Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Installs the necessary development packages for building Ghostty on Fedora. ```sh sudo dnf install \ gtk4-devel \ gtk4-layer-shell-devel \ zig \ libadwaita-devel \ gettext ``` -------------------------------- ### Run Ghostty with Nix without installation Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Try out Ghostty using `nix run` or `nix-shell` without a permanent installation. ```sh nix run nixpkgs#ghostty ``` ```sh nix-shell -p ghostty --run ghostty ``` -------------------------------- ### Install Ghostty on Gentoo Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Install Ghostty from the official Gentoo repository using the emerge command. ```shell emerge -av ghostty ``` -------------------------------- ### Install Debian/Ubuntu Dependencies Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Installs the development libraries and tools needed for building Ghostty on Debian and Ubuntu systems. ```sh sudo apt install \ libgtk-4-dev \ libgtk4-layer-shell-dev \ libadwaita-1-dev \ gettext \ libxml2-utils ``` -------------------------------- ### Example Custom Theme File Source: https://github.com/ghostty-org/website/blob/main/docs/features/theme.mdx An example of a complete custom theme file. Themes can define color palettes, background, foreground, cursor, and selection colors. Remember to review themes from untrusted sources for malicious configurations. ```ini palette = 0=#51576d palette = 1=#e78284 palette = 2=#a6d189 palette = 3=#e5c890 palette = 4=#8caaee palette = 5=#f4b8e4 palette = 6=#81c8be palette = 7=#a5adce palette = 8=#626880 palette = 9=#e67172 palette = 10=#8ec772 palette = 11=#d9ba73 palette = 12=#7b9ef0 palette = 13=#f2a4db palette = 14=#5abfb5 palette = 15=#b5bfe2 background = #303446 foreground = #c6d0f5 cursor-color = #f2d5cf cursor-text = #c6d0f5 selection-background = #626880 selection-foreground = #c6d0f5 ``` -------------------------------- ### Install Prerelease Ghostty from AUR Source: https://github.com/ghostty-org/website/blob/main/docs/install/pre.mdx Install the `ghostty-git` package from the Arch User Repository (AUR) to get the latest prerelease version of Ghostty on Arch Linux. This is community-maintained. ```sh # Install Ghostty git yay -S ghostty-git ``` -------------------------------- ### Install Alpine Dependencies Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Installs the necessary development packages for building Ghostty on Alpine Linux. ```sh doas apk add \ gtk4.0-dev \ libadwaita-dev \ pkgconf \ ncurses \ gettext ``` -------------------------------- ### Run Local Development Server Source: https://github.com/ghostty-org/website/blob/main/README.md Execute this command to start a local development server for the Ghostty website. Open http://localhost:3000 in your browser to view the site. ```bash make ``` -------------------------------- ### Install Arch Linux Dependencies Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Installs the required packages for building Ghostty on Arch Linux. ```sh sudo pacman -S \ gtk4 \ gtk4-layer-shell \ libadwaita \ gettext ``` -------------------------------- ### Build Ghostty with System-Wide Install Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Builds and installs Ghostty system-wide, typically into `/usr`. This command usually requires administrator privileges. ```sh zig build -p /usr -Doptimize=ReleaseFast ``` -------------------------------- ### Build Ghostty with Local Install Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Builds and installs Ghostty into the user's local directory (`~/.local`) for unprivileged installations. This ensures proper FHS directory structure for features like shell integration and icons. ```sh zig build -p $HOME/.local -Doptimize=ReleaseFast ``` -------------------------------- ### Install Homebrew Dependency Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Install the 'gettext' library using Homebrew, a common dependency for Ghostty. This is only necessary if you are not using the Nix development environment. ```shell brew install gettext ``` -------------------------------- ### Build Ghostty with Zig Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Build a release-optimized binary of Ghostty using the `zig build` command. Ensure Zig and other necessary dependencies are installed. ```bash zig build -Doptimize=ReleaseFast ``` -------------------------------- ### Install openSUSE Tumbleweed Dependencies Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Installs the development packages required for building Ghostty on openSUSE Tumbleweed. ```sh sudo zypper install \ gtk4-devel \ libadwaita-devel \ pkgconf \ ncurses-devel \ zig \ gettext ``` -------------------------------- ### Create New Window with Configuration Source: https://github.com/ghostty-org/website/blob/main/docs/features/applescript.mdx Example of creating a new Ghostty window using a surface configuration. This allows for pre-defined settings for the new window. ```applescript set cfg to new surface configuration set win to new window with configuration cfg ``` -------------------------------- ### Install Ghostty Package with Nix Source: https://github.com/ghostty-org/website/blob/main/docs/install/pre.mdx Configure NixOS to install Ghostty directly as a package for a specific system architecture. This is an alternative to using overlays. ```nix { pkgs, inputs, }: { # Installing the package directly users.users.somebody.packages = [ inputs.ghostty.${pkgs.stdenv.hostPlatform.system}.default ]; # Alternatively, using overlays: nixpkgs.overlays = [ inputs.ghostty.overlays.default ]; users.users.somebody.packages = [ pkgs.ghostty ]; } ``` -------------------------------- ### Install Fedora Atomic Dependencies Source: https://github.com/ghostty-org/website/blob/main/docs/install/build.mdx Installs the required packages for building Ghostty on Fedora Atomic variants using rpm-ostree. ```sh rpm-ostree install \ gtk4-devel \ gtk4-layer-shell-devel \ zig \ libadwaita-devel \ gettext ``` -------------------------------- ### Install Prerelease Ghostty with Homebrew Source: https://github.com/ghostty-org/website/blob/main/docs/install/pre.mdx Install the prerelease version of Ghostty on macOS using Homebrew by specifying the `@tip` cask. Note that this is community-maintained. ```shell brew install --cask ghostty@tip ``` -------------------------------- ### Install Ghostty on Nix-darwin Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Configure your Nix-darwin system to install Ghostty systemwide or for a specific user. ```nix { pkgs, }: { # Systemwide install environment.systemPackages = [ pkgs.ghostty-bin ]; # Install for a specific user users.users.somebody.packages = [ pkgs.ghostty-bin ]; } ``` -------------------------------- ### Object Model Exploration Source: https://github.com/ghostty-org/website/blob/main/docs/features/applescript.mdx Examples demonstrating how to navigate and query the Ghostty object model (application, windows, tabs, terminals) using AppleScript. ```APIDOC ## Object Model Exploration ### Description Examples demonstrating how to navigate and query the Ghostty object model (application, windows, tabs, terminals) using AppleScript. ### Object Model Hierarchy ```text application -> windows -> tabs -> terminals ``` ### Object Properties - `application`: `name`, `frontmost`, `front window`, `version` - `window`: `id`, `name`, `selected tab` - `tab`: `id`, `name`, `index`, `selected`, `focused terminal` - `terminal`: `id`, `name`, `working directory` ### Query Examples ```AppleScript tell application "Ghostty" set win to front window set tab1 to selected tab of win set term1 to focused terminal of tab1 set allTermsInWin to terminals of win set cwdMatches to every terminal whose working directory contains "ghostty" end tell ``` ### Active Context Scripting ```AppleScript tell application "Ghostty" set term to focused terminal of selected tab of front window input text "pwd\n" to term end tell ``` ### Splitting Terminal Example ```AppleScript tell application "Ghostty" set currentTerm to focused terminal of selected tab of front window set newTerm to split currentTerm direction right input text "echo split-ready\n" to newTerm end tell ``` ``` -------------------------------- ### Enable User Systemd Service Source: https://github.com/ghostty-org/website/blob/main/docs/linux/systemd.mdx Enable the Ghostty user service to start automatically on login. This ensures Ghostty is ready to create new windows instantly. ```sh systemctl enable --user app-com.mitchellh.ghostty.service ``` -------------------------------- ### Install Ghostty on Atomic Desktops (Silverblue) via RPM-OSTree Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Install Ghostty on Fedora Atomic Desktops after adding the COPR repository, using `rpm-ostree`. ```sh rpm-ostree refresh-md && \ rpm-ostree install ghostty ``` -------------------------------- ### Install Ghostty on Arch Linux Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Install the latest tagged release of Ghostty from the Arch Linux [extra] repository using pacman. ```shell pacman -S ghostty ``` -------------------------------- ### Hyprland Keybinding for New Ghostty Window Source: https://github.com/ghostty-org/website/blob/main/docs/linux/systemd.mdx Configure a keybinding in Hyprland to open a new Ghostty window using the `ghostty +new-window` command. This example binds `super+return`. ```conf bind = SUPER, return, exec, ghostty +new-window ``` -------------------------------- ### Install Ghostty on Alpine Linux Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Install Ghostty from the official Alpine Linux testing repository using the apk package manager. ```shell apk add ghostty ``` -------------------------------- ### End Key Sequence Example Source: https://github.com/ghostty-org/website/blob/main/docs/config/keybind/reference.mdx Example of binding a key sequence to end the current sequence and flush keys. This is useful for binding keys like Ctrl+W without sending additional inputs. ```ini ctrl+w>escape=end_key_sequence ``` -------------------------------- ### Select a Built-in Theme Source: https://github.com/ghostty-org/website/blob/main/docs/features/theme.mdx Use the `theme` configuration option to select from hundreds of built-in themes. For example, to use the Catppuccin Frappe theme. ```ini theme = Catppuccin Frappe ``` -------------------------------- ### CBT V-3: Left Starting on Tabstop Source: https://github.com/ghostty-org/website/blob/main/docs/vt/csi/cbt.mdx Illustrates the cursor starting on a tab stop and moving left to the same tab stop. The operation completes without moving the cursor. ```bash printf "\033[?5W" # reset tab stops printf "\033[1;9H" printf "X" printf "\033[1;9H" printf "\033[Z" printf "A" ``` -------------------------------- ### CUU V-1: Cursor Up Example Source: https://github.com/ghostty-org/website/blob/main/docs/vt/csi/cuu.mdx Demonstrates moving the cursor up by a specified number of lines. The `n` parameter defaults to 1 if omitted and must be at least 1. ```bash printf "\033[1;1H" # move to top-left printf "\033[0J" # clear screen printf "\033[3;1H" printf "A" printf "\033[2A" # cursor up printf "X" ``` -------------------------------- ### Install Ghostty on Fedora using Terra repository Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Add the Terra repository and install Ghostty, bypassing GPG check for the repository addition. ```sh dnf install --nogpgcheck --repofrompath 'terra,https://repos.fyralabs.com/terra$releasever' terra-release ``` ```sh dnf install ghostty ``` -------------------------------- ### Change Background and Cursor Colors Source: https://github.com/ghostty-org/website/blob/main/docs/vt/osc/1x.mdx This example demonstrates changing the background color to 'red' and the cursor color to 'blue' using OSC sequences. ```text OSC 11 ; red ; blue ST ``` -------------------------------- ### Run Latest Ghostty with Nix Source: https://github.com/ghostty-org/website/blob/main/docs/install/pre.mdx Execute the latest version of Ghostty directly from its GitHub repository using Nix. This method does not require a local installation. ```bash nix run github:ghostty-org/ghostty ``` -------------------------------- ### Query Ghostty Object Model Source: https://github.com/ghostty-org/website/blob/main/docs/features/applescript.mdx Examples demonstrating how to query the hierarchical object model of Ghostty (application -> windows -> tabs -> terminals) using AppleScript to get references to windows, tabs, and terminals. ```applescript tell application "Ghostty" set win to front window set tab1 to selected tab of win set term1 to focused terminal of tab1 set allTermsInWin to terminals of win set cwdMatches to every terminal whose working directory contains "ghostty" end tell ``` -------------------------------- ### Loading Multiple Configuration Files Source: https://github.com/ghostty-org/website/blob/main/docs/config/index.mdx Shows how to split configuration into multiple files using the 'config-file' key. Relative paths are supported, and paths prefixed with '?' are optional. ```ini config-file = some/relative/sub/config config-file = ?optional/config config-file = /absolute/path/config ``` -------------------------------- ### Install Ghostty on Fedora using COPR Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Install Ghostty after enabling the community-maintained COPR repository. ```sh dnf install ghostty ``` -------------------------------- ### Basic Configuration Syntax Source: https://github.com/ghostty-org/website/blob/main/docs/config/index.mdx Demonstrates the basic 'key = value' syntax for Ghostty configuration, including comments and blank lines. Values can be quoted or unquoted. Empty values reset the configuration to the default. ```ini # The syntax is "key = value". The whitespace around the # equals doesn't matter. background = 282c34 foreground = ffffff # Comments start with a `#` and are only valid on their own line. # Blank lines are ignored! keybind = ctrl+z=close_surface keybind = ctrl+d=new_split:right # Empty values reset the configuration to the default value font-family = ``` -------------------------------- ### Provide Initial Input to Commands Source: https://github.com/ghostty-org/website/blob/main/docs/config/reference.mdx Configure data to be sent as input to a command upon startup. Supports raw text or file content, with size limitations. ```ini input = raw:Hello, world! input = path:/path/to/file ``` ```ini input = "Hello, world!" ``` ```ini input = raw:first input = raw:second ``` -------------------------------- ### Install Ghostty via Homebrew Cask Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Use this command to install the Ghostty cask maintained by the community on macOS. ```shell brew install --cask ghostty ``` -------------------------------- ### List Available Themes via CLI Source: https://github.com/ghostty-org/website/blob/main/docs/features/theme.mdx To view a list of all available built-in themes, use the `+list-themes` command in the Ghostty CLI. ```sh ghostty +list-themes ``` -------------------------------- ### Basic SSH Connection with Ghostty Wrapper Source: https://github.com/ghostty-org/website/blob/main/docs/features/ssh.mdx Use this command to initiate an SSH connection through Ghostty's wrapper, preparing the remote session. ```sh ghostty +ssh -- user@example.com ``` -------------------------------- ### REP V-1: Simple Usage Source: https://github.com/ghostty-org/website/blob/main/docs/vt/csi/rep.mdx Demonstrates basic usage of the REP sequence to repeat the character 'A'. Ensure the cursor is at the top-left and the screen is cleared before execution. ```bash printf "\033[1;1H" # move to top-left printf "\033[0J" # clear screen printf "A" printf "\033[b" ``` -------------------------------- ### SU V-1: Simple Usage Source: https://github.com/ghostty-org/website/blob/main/docs/vt/csi/su.mdx Demonstrates basic Scroll Up functionality. Ensure the cursor is at the top-left and the screen is cleared before execution. ```bash printf "\033[1;1H" # move to top-left printf "\033[0J" # clear screen printf "ABC\n" printf "DEF\n" printf "GHI\n" printf "\033[2;2H" printf "\033[S" ``` -------------------------------- ### Debug Ghostty Systemd Service File Locations (User Install) Source: https://github.com/ghostty-org/website/blob/main/docs/linux/systemd.mdx Paths for systemd service control files when Ghostty debug builds are installed as a user. These files manage the launching of debug versions. ```text $PREFIX/share/applications/com.mitchellh.ghostty-debug.desktop $PREFIX/share/dbus-1/services/com.mitchellh.ghostty-debug.service $PREFIX/share/systemd/user/app-com.mitchellh.ghostty-debug.service ``` -------------------------------- ### Creating and Layout Commands Source: https://github.com/ghostty-org/website/blob/main/docs/features/applescript.mdx Commands for creating new windows, tabs, and splitting terminals, with options for configurations. ```APIDOC ## Creation and Layout Commands ### Description Commands for creating new windows, tabs, and splitting terminals, with options for configurations. ### Commands - `new surface configuration`: Creates a reusable surface configuration record. - Example: `set cfg to new surface configuration` - `new window`: Creates a new window. - Example: `set win to new window with configuration cfg` - `new tab`: Creates a new tab in an optional target window. - Example: `set t to new tab in win with configuration cfg` - `split`: Splits a terminal and returns the new terminal. - Example: `set t2 to split t1 direction right with configuration cfg` - `direction` values: `right`, `left`, `down`, `up`. ``` -------------------------------- ### Debug Ghostty Systemd Service File Locations (System Install) Source: https://github.com/ghostty-org/website/blob/main/docs/linux/systemd.mdx Paths for systemd service control files when Ghostty debug builds are installed as a system package. These files manage the launching of debug versions. ```text $PREFIX/share/applications/com.mitchellh.ghostty-debug.desktop $PREFIX/share/dbus-1/services/com.mitchellh.ghostty-debug.service $PREFIX/lib/systemd/user/app-com.mitchellh.ghostty-debug.service ``` -------------------------------- ### SD Sequence Example: Outside Scroll Region Source: https://github.com/ghostty-org/website/blob/main/docs/vt/csi/sd.mdx Demonstrates the Scroll Down (SD) sequence when invoked outside the defined top/bottom scroll region. This example clears the screen, sets up a scroll region, and then applies the SD sequence. ```bash printf "\033[1;1H" # move to top-left printf "\033[0J" # clear screen printf "ABC\n" printf "DEF\n" printf "GHI\n" printf "\033[3;4r" # scroll region top/bottom printf "\033[2;2H" printf "\033[T" ``` -------------------------------- ### Script New Ghostty Windows with D-Bus Source: https://github.com/ghostty-org/website/blob/main/docs/linux/systemd.mdx Create a new Ghostty window using the `+new-window` command, which leverages D-Bus activation. This is faster than running the `ghostty` binary directly and will launch Ghostty if it's not already running. ```sh ghostty +new-window ``` -------------------------------- ### Verifying Scripting Support Source: https://github.com/ghostty-org/website/blob/main/docs/features/applescript.mdx This command verifies that AppleScript is enabled and working correctly with your Ghostty installation. ```APIDOC ## Verify Scripting Support ### Description Verifies that AppleScript is enabled and working correctly with your Ghostty installation. ### Command ```sh osascript -e 'tell application "Ghostty" to get version' ``` ``` -------------------------------- ### Install Ghostty with Nix on NixOS Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Add Ghostty to your system-wide or user-specific packages in your NixOS configuration. ```nix { pkgs, }: { # Systemwide install environment.systemPackages = [ pkgs.ghostty ]; # Install for a specific user users.users.somebody.packages = [ pkgs.ghostty ]; } ``` -------------------------------- ### Make Ghostty AppImage Executable Source: https://github.com/ghostty-org/website/blob/main/docs/install/binary.mdx Grants execute permissions to the downloaded AppImage file. Replace placeholders with actual version and architecture. ```bash chmod a+x Ghostty-${VERSION}-${ARCH}.appimage ``` -------------------------------- ### Simple Delete Character Source: https://github.com/ghostty-org/website/blob/main/docs/vt/csi/dch.mdx Deletes 2 characters starting from the current position, shifting the remaining characters to the left. ```bash printf "ABC123" printf "\033[3G" printf "\033[2P" ``` -------------------------------- ### Change Cursor Color Source: https://github.com/ghostty-org/website/blob/main/docs/vt/osc/1x.mdx This sequence changes the cursor color to 'blue'. It is an example of a single color change operation. ```text OSC 12 ; blue ST ```