{"id":27948603,"url":"https://github.com/cryptocode/ghosttyold","last_synced_at":"2025-07-24T06:41:16.399Z","repository":{"id":270776635,"uuid":"808964562","full_name":"cryptocode/ghosttyold","owner":"cryptocode","description":"👻","archived":false,"fork":false,"pushed_at":"2024-08-28T17:01:43.000Z","size":38453,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-07T14:59:31.893Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://discord.gg/ghostty","language":"Zig","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cryptocode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-01T09:44:59.000Z","updated_at":"2025-04-15T16:24:34.000Z","dependencies_parsed_at":"2025-01-03T03:02:45.624Z","dependency_job_id":null,"html_url":"https://github.com/cryptocode/ghosttyold","commit_stats":null,"previous_names":["cryptocode/ghostty","cryptocode/ghosttyold"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocode%2Fghosttyold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocode%2Fghosttyold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocode%2Fghosttyold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocode%2Fghosttyold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cryptocode","download_url":"https://codeload.github.com/cryptocode/ghosttyold/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902602,"owners_count":21822258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T14:59:39.757Z","updated_at":"2025-05-07T14:59:40.443Z","avatar_url":"https://github.com/cryptocode.png","language":"Zig","readme":"\u003c!-- LOGO --\u003e\n\u003ch1\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/1299/199110421-9ff5fc30-a244-441e-9882-26070662adf9.png\" alt=\"Logo\" width=\"100\"\u003e\n  \u003cbr\u003eGhostty\n\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    Fast, native, feature-rich terminal emulator pushing modern features.\n    \u003cbr /\u003e\n    \u003ca href=\"#about\"\u003eAbout\u003c/a\u003e\n    ·\n    \u003ca href=\"#download\"\u003eDownload\u003c/a\u003e\n    ·\n    \u003ca href=\"#roadmap-and-status\"\u003eRoadmap\u003c/a\u003e\n    ·\n    \u003ca href=\"#developing-ghostty\"\u003eDeveloping\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/ghostty-org/ghostty/blob/main/README_TESTERS.md\"\u003e\u003cb\u003eTesters! Read This Too!\u003c/b\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## About\n\nGhostty is a cross-platform, GPU-accelerated terminal emulator that aims to\npush the boundaries of what is possible with a terminal emulator by exposing\nmodern, opt-in features that enable CLI tool developers to build more feature\nrich, interactive applications.\n\nThere are a number of excellent terminal emulator options that exist\ntoday. The unique goal of Ghostty is to have a platform for experimenting\nwith modern, optional, non-standards-compliant features to enhance the\ncapabilities of CLI applications. We aim to be the best in this category,\nand competitive in the rest.\n\nWhile aiming for this ambitious goal, our first step is to make Ghostty\none of the best fully standards compliant terminal emulator, remaining\ncompatible with all existing shells and software while supporting all of\nthe latest terminal innovations in the ecosystem. You can use Ghostty\nas a drop-in replacement for your existing terminal emulator.\n\n**Project Status:** Ghostty is still in beta but implements most of the\nfeatures you'd expect for a daily driver. We currently have hundreds of active\nbeta users using Ghostty as their primary terminal. See more in\n[Roadmap and Status](#roadmap-and-status).\n\n## Download\n\n| Platform / Package | Links                                                                      | Notes                      |\n| ------------------ | -------------------------------------------------------------------------- | -------------------------- |\n| macOS              | [Tip (\"Nightly\")](https://github.com/ghostty-org/ghostty/releases/tag/tip) | MacOS 12+ Universal Binary |\n| Linux              | [Build from Source](#developing-ghostty)                                   |                            |\n| Linux (NixOS/Nix)  | [Use the Flake](#nix-package)                                              |                            |\n| Linux (Arch)       | [Use the AUR package](https://aur.archlinux.org/packages/ghostty-git)      |                            |\n| Windows            | [Build from Source](#developing-ghostty)                                   | [Notes](#windows-notes)    |\n\n### Configuration\n\nTo configure Ghostty, you must use a configuration file. GUI-based configuration\nis on the roadmap but not yet supported. The configuration file must be\nplaced at `$XDG_CONFIG_HOME/ghostty/config`, which defaults to\n`~/.config/ghostty/config` if the [XDG environment is not set](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).\n\nThe file format is documented below as an example:\n\n```\n# The syntax is \"key = value\". The whitespace around the equals doesn't matter.\nbackground = 282c34\nforeground= ffffff\n\n# Blank lines are ignored!\n\nkeybind = ctrl+z=close_surface\nkeybind = ctrl+d=new_split:right\n\n# Empty values reset the configuration to the default value\n\nfont-family =\n\n# Colors can be changed by setting the 16 colors of `palette`, which each color\n# being defined as regular and bold.\n#\n# black\npalette = 0=#1d2021\npalette = 8=#7c6f64\n# red\npalette = 1=#cc241d\npalette = 9=#fb4934\n# green\npalette = 2=#98971a\npalette = 10=#b8bb26\n# yellow\npalette = 3=#d79921\npalette = 11=#fabd2f\n# blue\npalette = 4=#458588\npalette = 12=#83a598\n# purple\npalette = 5=#b16286\npalette = 13=#d3869b\n# aqua\npalette = 6=#689d6a\npalette = 14=#8ec07c\n# white\npalette = 7=#a89984\npalette = 15=#fbf1c7\n```\n\nYou can view all available configuration options and their documentation\nby executing the command `ghostty +show-config --default --docs`. Note that\nthis will output the full default configuration with docs to stdout, so\nyou may want to pipe that through a pager, an editor, etc.\n\n\u003e [!NOTE]\n\u003e\n\u003e You'll see a lot of weird blank configurations like `font-family =`. This\n\u003e is a valid syntax to specify the default behavior (no value). The\n\u003e `+show-config` outputs it so it's clear that key is defaulting and also\n\u003e to have something to attach the doc comment to.\n\nYou can also see and read all available configuration options in the source\n[Config structure](https://github.com/ghostty-org/ghostty/blob/main/src/config/Config.zig).\nThe available keys are the keys verbatim, and their possible values are typically\ndocumented in the comments. You also can search for the\n[public config files](https://github.com/search?q=path%3Aghostty%2Fconfig\u0026type=code)\nof many Ghostty users for examples and inspiration.\n\n\u003e [!NOTE]\n\u003e\n\u003e Configuration can be reloaded on the fly with the `reload_config`\n\u003e command. Not all configuration options can change without restarting Ghostty.\n\u003e Any options that require a restart should be documented.\n\n#### Configuration Errors\n\nIf your configuration file has any errors, Ghostty does its best to ignore\nthem and move on. Configuration errors currently show up in the log. The\nlog is written directly to stderr, so it is up to you to figure out how to\naccess that for your system (for now). On macOS, you can also use the\nsystem `log` CLI utility. See the [Mac App](#mac-app) section for more\ninformation.\n\n#### Debugging Configuration\n\nYou can verify that configuration is being properly loaded by looking at\nthe debug output of Ghostty. Documentation for how to view the debug output\nis in the \"building Ghostty\" section at the end of the README.\n\nIn the debug output, you should see in the first 20 lines or so messages\nabout loading (or not loading) a configuration file, as well as any errors\nit may have encountered. Configuration errors are also shown in a dedicated\nwindow on both macOS and Linux (GTK). Ghostty does not treat configuration\nerrors as fatal and will fall back to default values for erroneous keys.\n\nYou can also view the full configuration Ghostty is loading using\n`ghostty +show-config` from the command-line. Use the `--help` flag to\nadditional options for that command.\n\n### Themes\n\nGhostty ships with 300+ built-in themes (from\n[iTerm2 Color Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes)).\nYou can configure Ghostty to use any of these themes using the `theme`\nconfiguration. Example:\n\n```\ntheme = Solarized Dark - Patched\n```\n\nYou can find a list of built-in themes using the `+list-themes` action:\n\n```\nghostty +list-themes\n...\n```\n\nOn macOS, the themes are built-in to the `Ghostty.app` bundle. On Linux,\ntheme support requires a valid Ghostty resources dir (\"share\" directory).\nMore details about how to validate the resources directory on Linux\nis covered in the [shell integration section](#shell-integration-installation-and-verification).\n\nAny custom color configuration (`palette`, `background`, `foreground`, etc.)\nin your configuration files will override the theme settings. This can be\nused to load a theme and fine-tune specific colors to your liking.\n\n**Interested in contributing a new theme or updating an existing theme?**\nPlease send theme changes upstream to the\n[iTerm2 Color Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes))\nrepository. Ghostty periodically updates the themes from this source.\n_Do not send theme changes to the Ghostty project directly_.\n\n### Shell Integration\n\nGhostty supports some features that require shell integration. I am aiming\nto support many of the features that\n[Kitty supports for shell integration](https://sw.kovidgoyal.net/kitty/shell-integration/).\n\nThe currently supported shell integration features in Ghostty:\n\n- We do not confirm close for windows where the cursor is at a prompt.\n- New terminals start in the working directory of the previously focused terminal.\n- Complex prompts resize correctly by allowing the shell to redraw the prompt line.\n- Triple-click while holding control (Linux) or command (macOS) to select the output of a command.\n- The cursor at the prompt is turned into a bar.\n- The `jump_to_prompt` keybinding can be used to scroll the terminal window\n  forward and back through prompts.\n- Alt+click (option+click on macOS) to move the cursor at the prompt.\n- `sudo` is wrapped to preserve Ghostty terminfo (disabled by default)\n\n#### Shell Integration Installation and Verification\n\nGhostty will automatically inject the shell integration code for `bash`, `zsh`\nand `fish`. Other shells do not have shell integration code written but will\nfunction fine within Ghostty with the above mentioned shell integration features\ninoperative. **If you want to disable automatic shell integration,** set\n`shell-integration = none` in your configuration file.\n\nAutomatic `bash` shell integration requires Bash version 4 or later and must be\nexplicitly enabled by setting `shell-integration = bash`.\n\n**For the automatic shell integration to work,** Ghostty must either be run\nfrom the macOS app bundle or be installed in a location where the contents of\n`zig-out/share` are available somewhere above the directory where Ghostty\nis running from. On Linux, this should automatically work if you run from\nthe `zig-out` directory tree structure (a standard FHS-style tree).\n\nYou may also manually set the `GHOSTTY_RESOURCES_DIR` to point to the\n`zig-out/share/ghostty` contents. To validate this directory the file\n`$GHOSTTY_RESOURCES_DIR/../terminfo/ghostty.terminfo` should exist.\n\nTo verify shell integration is working, look for the following log lines:\n\n```\ninfo(io_exec): using Ghostty resources dir from env var: /Applications/Ghostty.app/Contents/Resources\ninfo(io_exec): shell integration automatically injected shell=termio.shell_integration.Shell.fish\n```\n\nIf you see any of the following, something is not working correctly.\nThe main culprit is usually that `GHOSTTY_RESOURCES_DIR` is not pointing\nto the right place.\n\n```\nghostty terminfo not found, using xterm-256color\n\nor\n\nshell could not be detected, no automatic shell integration will be injected\n```\n\n#### Switching Shells with Shell Integration\n\nAutomatic shell integration as described in the previous section only works\nfor the _initially launched shell_ when Ghostty is started. If you switch\nshells within Ghostty, i.e. you manually run `bash` or you use a command\nlike `nix-shell`, the shell integration _will be lost_ in that shell\n(it will keep working in the original shell process).\n\nTo make shell integration work in these cases, you must manually source\nthe Ghostty shell-specific code at the top of your shell configuration\nfiles. Ghostty will automatically set the `GHOSTTY_RESOURCES_DIR` environment\nvariable when it starts, so you can use this to (1) detect your shell\nis launched within Ghostty and (2) to find the shell-integration.\n\nFor example, for bash, you'd put this _at the top_ of your `~/.bashrc`:\n\n```bash\n# Ghostty shell integration for Bash. This must be at the top of your bashrc!\nif [ -n \"${GHOSTTY_RESOURCES_DIR}\" ]; then\n    builtin source \"${GHOSTTY_RESOURCES_DIR}/shell-integration/bash/ghostty.bash\"\nfi\n```\n\nEach shell integration's installation instructions are documented inline:\n\n| Shell  | Integration                                                                                    |\n| ------ | ---------------------------------------------------------------------------------------------- |\n| `bash` | `${GHOSTTY_RESOURCES_DIR}/shell-integration/bash/ghostty.bash`                                 |\n| `fish` | `${GHOSTTY_RESOURCES_DIR}/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish` |\n| `zsh`  | `${GHOSTTY_RESOURCES_DIR}/shell-integration/zsh/ghostty-integration`                           |\n\n### Terminfo\n\nGhostty ships with its own [terminfo](https://en.wikipedia.org/wiki/Terminfo)\nentry to tell software about its capabilities. When that entry is detected,\nGhostty sets the `TERM` environment variable to `xterm-ghostty`.\n\nIf the Ghostty resources dir (\"share\" directory) is detected, Ghostty will\nset a `TERMINFO` environment variable so `xterm-ghostty` properly advertises\nthe available capabilities of Ghostty. On macOS, this always happens because\nthe terminfo is embedded in the app bundle. On Linux, this depends on\nappropriate installation (see the installation instructions).\n\nIf you use `sudo`, sudo may reset your environment variables and you may see\nan error about `missing or unsuitable terminal: xterm-ghostty` when running\nsome programs. To resolve this, you must either configure sudo to preserve\nthe `TERMINFO` environment variable, or you can use shell-integration with\nthe `sudo` feature enabled and Ghostty will alias sudo to automatically do\nthis for you. To enable the shell-integration feature specify\n`shell-integration-features = sudo` in your configuration.\n\nIf you use SSH to connect to other machines that do not have Ghostty's terminfo\nentry, you will see error messages like `missing or unsuitable terminal:\nxterm-ghostty`.\n\nHopefully someday Ghostty will have terminfo entries pre-distributed\neverywhere, but in the meantime there are two ways to resolve the situation:\n\n1.  Copy Ghostty's terminfo entry to the remote machine.\n2.  Configure SSH to fall back to a known terminfo entry.\n\n#### Copy Ghostty's terminfo to a remote machine\n\nThe following one-liner will export the terminfo entry from your host and\nimport it on the remote machine:\n\n```shell-session\ninfocmp -x | ssh YOUR-SERVER -- tic -x -\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e **macOS versions before Sonoma cannot use the system-bundled `infocmp`.**\n\u003e The bundled version of `ncurses` is too old to emit a terminfo entry that can be\n\u003e read by more recent versions of `tic`, and the command will fail with a bunch\n\u003e of `Illegal character` messages. You can fix this by using Homebrew to install\n\u003e a recent version of `ncurses` and replacing `infocmp` above with the full path\n\u003e `/opt/homebrew/opt/ncurses/bin/infocmp`.\n\n#### Configure SSH to fall back to a known terminfo entry\n\nIf copying around terminfo entries is untenable, you can override `TERM` to a\nfallback value using SSH config.\n\n```ssh-config\n# .ssh/config\nHost example.com\n  SetEnv TERM=xterm-256color\n```\n\n**Requires OpenSSH 8.7 or newer.** [The 8.7 release added\nsupport](https://www.openssh.com/txt/release-8.7) for setting `TERM` via\n`SetEnv`.\n\n\u003e [!WARNING]\n\u003e\n\u003e **Fallback does not support advanced terminal features.** Because\n\u003e `xterm-256color` does not include all of Ghostty's capabilities, terminal\n\u003e features beyond xterm's like colored and styled underlines will not work.\n\n## Roadmap and Status\n\nThe high-level ambitious plan for the project, in order:\n\n|  #  | Step                                                      | Status |\n| :-: | --------------------------------------------------------- | :----: |\n|  1  | Standards-compliant terminal emulation                    |   ✅   |\n|  2  | Competitive performance                                   |   ✅   |\n|  3  | Basic customizability -- fonts, bg colors, etc.           |   ✅   |\n|  4  | Richer windowing features -- multi-window, tabbing, panes |   ✅   |\n|  5  | Native Platform Experiences (i.e. Mac Preference Panel)   |   ⚠️   |\n|  6  | Cross-platform `libghostty` for Embeddable Terminals      |   ⚠️   |\n|  7  | Windows Terminals (including PowerShell, Cmd, WSL)        |   ❌   |\n|  N  | Fancy features (to be expanded upon later)                |   ❌   |\n\nAdditional details for each step in the big roadmap below:\n\n#### Standards-Compliant Terminal Emulation\n\nGhostty implements enough control sequences to be used by hundreds of\ntesters daily for over the past year. Further, we've done a\n[comprehensive xterm audit](https://github.com/ghostty-org/ghostty/issues/632)\ncomparing Ghostty's behavior to xterm and building a set of conformance\ntest cases.\n\nWe believe Ghostty is one of the most compliant terminal emulators available.\n\nTerminal behavior is partially a dejour standard\n(i.e. [ECMA-48](https://ecma-international.org/publications-and-standards/standards/ecma-48/))\nbut mostly a defacto standard as defined by popular terminal emulators\nworldwide. Ghostty takes the approach that our behavior is defined by\n(1) standards, if available, (2) xterm, if the feature exists, (3)\nother popular terminals, in that order. This defines what the Ghostty project\nviews as a \"standard.\"\n\n#### Competitive Performance\n\nWe need better benchmarks to continuously verify this, but Ghostty is\ngenerally in the same performance category as the other highest performing\nterminal emulators.\n\nFor rendering, we have a multi-renderer architecture that uses OpenGL on\nLinux and Metal on macOS. As far as I'm aware, we're the only terminal\nemulator other than iTerm that uses Metal directly. And we're the only\nterminal emulator that has a Metal renderer that supports ligatures (iTerm\nuses a CPU renderer if ligatures are enabled). We can maintain around 60fps\nunder heavy load and much more generally -- though the terminal is\nusually rendering much lower due to little screen changes.\n\nFor IO, we have a dedicated IO thread that maintains very little jitter\nunder heavy IO load (i.e. `cat \u003cbig file\u003e.txt`). On benchmarks for IO,\nwe're usually within a small margin of other fast terminal emulators.\nFor example, reading a dump of plain text is 4x faster compared to iTerm and\nKitty, and 2x faster than Terminal.app. Alacritty is very fast but we're still\naround the same speed (give or take) and our app experience is much more\nfeature rich.\n\n\u003e [!NOTE]\n\u003e Despite being _very fast_, there is a lot of room for improvement here.\n\u003e We still consider some aspects of our performance a \"bug\" and plan on\n\u003e taking a dedicated pass to improve performance before public release.\n\n#### Richer Windowing Features\n\nThe Mac and Linux (build with GTK) apps support multi-window, tabbing, and\nsplits.\n\n#### Native Platform Experiences\n\nGhostty is a cross-platform terminal emulator but we don't aim for a\nleast-common-denominator experience. There is a large, shared core written\nin Zig but we do a lot of platform-native things:\n\n- The macOS app is a true SwiftUI-based application with all the things you\n  would expect such as real windowing, menu bars, a settings GUI, etc.\n- macOS uses a true Metal renderer with CoreText for font discovery.\n- The Linux app is built with GTK.\n\nThere are more improvements to be made. The macOS settings window is still\na work-in-progress. Similar improvements will follow with Linux.\n\n#### Cross-platform `libghostty` for Embeddable Terminals\n\nIn addition to being a standalone terminal emulator, Ghostty is a\nC-compatible library for embedding a fast, feature-rich terminal emulator\nin any 3rd party project. This library is called `libghostty`.\n\nThis goal is not hypothetical! The macOS app is a `libghostty` consumer.\nThe macOS app is a native Swift app developed in Xcode and `main()` is\nwithin Swift. The Swift app links to `libghostty` and uses the C API to\nrender terminals.\n\nThis step encompasses expanding `libghostty` support to more platforms\nand more use cases. At the time of writing this, `libghostty` is very\nMac-centric -- particularly around rendering -- and we have work to do to\nexpand this to other platforms.\n\n## Developing Ghostty\n\nTo build Ghostty, you need [Zig 0.13](https://ziglang.org/) installed.\n\nOn Linux, you may need to install additional dependencies. See\n[Linux Installation Tips](#linux-installation-tips). On macOS, you\nneed Xcode installed with the macOS and iOS SDKs enabled. See\n[Mac `.app`](#mac-app).\n\nThe official development environment is defined by Nix. You do not need\nto use Nix to develop Ghostty, but the Nix environment is the environment\nwhich runs CI tests and builds release artifacts. Any development work on\nGhostty must pass within these Nix environments.\n\n\u003e [!NOTE]\n\u003e\n\u003e **Zig 0.13 is required.** Ghostty only guarantees that it can build\n\u003e against 0.13. Zig is still a fast-moving project so it is likely newer\n\u003e versions will not be able to build Ghostty yet. You can find binary\n\u003e releases of Zig release builds on the\n\u003e [Zig downloads page](https://ziglang.org/download/).\n\nWith Zig and necessary dependencies installed, a binary can be built using\n`zig build`:\n\n```shell-session\nzig build\n...\n\nzig-out/bin/ghostty\n```\n\nThis will build a binary for the currently running system (if supported).\n**Note: macOS does not result in a runnable binary with this command.**\nmacOS builds produce a library (`libghostty.a`) that is used by the Xcode\nproject in the `macos` directory to produce the final `Ghostty.app`.\n\nOn Linux or macOS, you can use `zig build -Dapp-runtime=glfw run` for a quick\nGLFW-based app for a faster development cycle while developing core\nterminal features. Note that this app is missing many features and is also\nknown to crash in certain scenarios, so it is only meant for development\ntasks.\n\nOther useful commands:\n\n- `zig build test` for running unit tests.\n- `zig build run -Dconformance=\u003cname\u003e` runs a conformance test case from\n  the `conformance` directory. The `name` is the name of the file. This runs\n  in the current running terminal emulator so if you want to check the\n  behavior of this project, you must run this command in Ghostty.\n\n### Compiling a Release Build\n\nThe normal build will be a _debug build_ which includes a number of\nsafety features as well as debugging features that dramatically slow down\nnormal operation of the terminal (by as much as 100x). If you are building\na terminal for day to day usage, build a release version:\n\n```shell-session\nzig build -Doptimize=ReleaseFast\n...\n```\n\nYou can verify you have a release version by checking the filesize of the\nbuilt binary (`zig-out/bin/ghostty`). The release version should be less\nthan 5 MB on all platforms. The debug version is around 70MB.\n\nWhen using the GTK runtime (`-Dapp-runtime=gtk`) a release build will\nuse a [single-instance application](https://developer.gnome.org/documentation/tutorials/application.html).\nIf you're developing Ghostty from _inside_ a release build and build \u0026 launch a\nnew one that will not reflect the changes you made, but instead launch a new\nwindow for the existing instance. You can disable this behaviour with the\n`--gtk-single-instance=false` flag or by adding `gtk-single-instance = false` to\nthe configuration file.\n\n### Linux Installation Tips\n\nOn Linux, you'll need to install header packages for Ghostty's dependencies\nbefore building it. Typically, these are only gtk4 and libadwaita (unless\nbuilding with `-Dstatic=false`). On Ubuntu and Debian, use\n\n```\nsudo apt install libgtk-4-dev libadwaita-1-dev git\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e **A recent GTK is required for Ghostty to work with Nvidia (GL) drivers\n\u003e under x11.** Ubuntu 22.04 LTS has GTK 4.6 which is not new enough. Ubuntu 23.10\n\u003e has GTK 4.12 and works. From [this discussion](https://discourse.gnome.org/t/opengl-context-version-not-respected-on-gtk4-rs/12162?u=cdehais)\n\u003e the problem was fixed in GTK by Dec 2022. Also, if you are a BTRFS user, make\n\u003e sure to manually upgrade your Kernel (6.6.6 will work). The stock kernel in\n\u003e Ubuntu 23.10 is 6.5.0 which has a bug which\n\u003e [causes zig to fail its hash check for packages](https://github.com/ziglang/zig/issues/17282).\n\n\u003e [!WARNING]\n\u003e\n\u003e GTK 4.14 on Wayland has a bug which may cause an immediate crash.\n\u003e There is an [open issue](https://gitlab.gnome.org/GNOME/gtk/-/issues/6589/note_2072039)\n\u003e to track this GTK bug. You can workaround this issue by running ghostty with\n\u003e `GDK_DEBUG=gl-disable-gles ghostty`\n\nOn Arch Linux, use\n\n```\nsudo pacman -S gtk4 libadwaita\n```\n\nIf you're planning to use a build from source as your daily driver,\nI recommend using the `-p` (prefix) flag for `zig build` to install\nGhostty into `~/.local`. This will setup the proper FHS directory structure\nthat ensures features such as shell integration, icons, GTK shortcuts, etc.\nall work.\n\n```\nzig build -p $HOME/.local -Doptimize=ReleaseFast\n...\n```\n\nWith a typical Freedesktop-compatible desktop environment (i.e. Gnome,\nKDE), this will make Ghostty available as an app in your app launcher.\nNote, if you don't see it immediately you may have to log out and log back\nin or maybe even restart. For my Gnome environment, it showed up within a\nfew seconds. For any other desktop environment, you can launch Ghostty\ndirectly using `~/.local/bin/ghostty`.\n\nIf Ghostty fails to launch using an app icon in your app launcher,\nensure that `~/.local/bin` is on your _system_ `PATH`. The desktop environment\nitself must have that path in the `PATH`. Google for your specific desktop\nenvironment and distribution to learn how to do that.\n\nThis _isn't required_, but `~/.local` is a directory that happens to be\non the search path for a lot of software (such as Gnome and KDE) and\ninstalling into a prefix with `-p` sets up a directory structure to ensure\nall features of Ghostty work.\n\n### Mac `.app`\n\nTo build the official, fully featured macOS application, you must\nbuild on a macOS machine with Xcode installed, and the active developer\ndirectory pointing to it. If you're not sure that's the case, check the\noutput of `xcode-select --print-path`:\n\n```shell-session\nxcode-select --print-path\n/Library/Developer/CommandLineTools        # \u003c-- BAD\nsudo xcode-select --switch /Applications/Xcode.app/Contents/Developer\nxcode-select --print-path\n/Applications/Xcode.app/Contents/Developer # \u003c-- GOOD\n```\n\nThe above can happen if you install the Xcode Command Line Tools _after_ Xcode\nis installed. With that out of the way, make sure you have both the macOS and\niOS SDKs installed (from inside Xcode → Settings → Platforms), and let's move\non to building Ghostty:\n\n```shell-session\nzig build -Doptimize=ReleaseFast\ncd macos \u0026\u0026 xcodebuild\n```\n\n\u003e [!NOTE]\n\u003e If you're using the Nix environment on macOS, `xcodebuild` will\n\u003e fail due to the linker environment variables Nix sets. You must\n\u003e run the `xcodebuild` command specifically outside of the Nix\n\u003e environment.\n\nThis will output the app to `macos/build/ReleaseLocal/Ghostty.app`.\nThis app will be not be signed or notarized.\n[Official continuous builds are available](https://github.com/ghostty-org/ghostty/releases/tag/tip)\nthat are both signed and notarized.\n\nThe \"ReleaseLocal\" build configuration is specifically for local release\nbuilds and disables some security features (such as \"Library Validation\")\nto make it easier to run without having to have a code signing identity\nand so on. These builds aren't meant for distribution. If you want a release\nbuild with all security features, I highly recommend you use\n[the official continuous builds](https://github.com/ghostty-org/ghostty/releases/tag/tip).\n\nWhen running the app, logs are available via macOS unified logging such\nas `Console.app`. The easiest way I've found to view these is to just use the CLI:\n\n```sh\nsudo log stream --level debug --predicate 'subsystem==\"com.mitchellh.ghostty\"'\n...\n```\n\n### Windows Notes\n\nWindows support is still a [work-in-progress](https://github.com/ghostty-org/ghostty/issues/437).\nThe current status is that a bare bones glfw-based build _works_! The experience\nwith this build is super minimal: there are no native experiences, only a\nsingle window is supported, no tabs, etc. Therefore, the current status is\nsimply that the core terminal experience works.\n\nIf you want to help with Windows development, please see the\n[tracking issue](https://github.com/ghostty-org/ghostty/issues/437). We plan\non vastly improving this experience over time.\n\n### Linting\n\n#### Prettier\n\nGhostty's docs and resources (not including Zig code) are linted using\n[Prettier](https://prettier.io) with out-of-the-box settings. A Prettier CI\ncheck will fail builds with improper formatting. Therefore, if you are\nmodifying anything Prettier will lint, you may want to install it locally and\nrun this from the repo root before you commit:\n\n```\nprettier --write .\n```\n\nMake sure your Prettier version matches the version of Prettier in [devShell.nix](https://github.com/ghostty-org/ghostty/blob/main/nix/devShell.nix).\n\nNix users can use the following command to format with Prettier:\n\n```\nnix develop -c prettier --write .\n```\n\n#### Alejandra\n\nNix modules are formatted with [Alejandra](https://github.com/kamadorueda/alejandra/). An Alejandra CI check\nwill fail builds with improper formatting.\n\nNix users can use the following command to format with Alejanda:\n\n```\nnix develop -c alejandra .\n```\n\nNon-Nix users should install Alejandra and use the following command to format with Alejandra:\n\n```\nalejandra .\n```\n\nMake sure your Alejandra version matches the version of Alejandra in [devShell.nix](https://github.com/ghostty-org/ghostty/blob/main/nix/devShell.nix).\n\n### Nix Package\n\nThere is Nix package that can be used in the flake (`packages.ghostty` or `packages.default`).\nIt can be used in NixOS configurations and otherwise built off of.\n\nBelow is an example:\n\n```nix\n{\n  inputs = {\n    nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";\n\n    # NOTE: This will require your git SSH access to the repo.\n    #\n    # WARNING: Do NOT pin the `nixpkgs` input, as that will\n    # declare the cache useless. If you do, you will have\n    # to compile LLVM, Zig and Ghostty itself on your machine,\n    # which will take a very very long time.\n    ghostty = {\n      url = \"git+ssh://git@github.com/ghostty-org/ghostty\";\n    };\n  };\n\n  outputs = { nixpkgs, ghostty, ... }: {\n    nixosConfigurations.mysystem = nixpkgs.lib.nixosSystem {\n      modules = [\n        {\n          environment.systemPackages = [\n            ghostty.packages.x86_64-linux.default\n          ];\n        }\n      ];\n    };\n  };\n}\n```\n\nYou can also test the build of the nix package at any time by running `nix build .`.\n\n#### Updating the Zig Cache Fixed-Output Derivation Hash\n\nThe Nix package depends on a [fixed-output\nderivation](https://nix.dev/manual/nix/stable/language/advanced-attributes.html#adv-attr-outputHash)\nthat manages the Zig package cache. This allows the package to be built in the\nNix sandbox.\n\nOccasionally (usually when `build.zig.zon` is updated), the hash that\nidentifies the cache will need to be updated. There are jobs that monitor the\nhash in CI, and builds will fail if it drifts.\n\nTo update it, you can run the following in the repository root:\n\n```\n./nix/build-support/check-zig-cache-hash.sh --update\n```\n\nThis will write out the `nix/zigCacheHash.nix` file with the updated hash\nthat can then be committed and pushed to fix the builds.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptocode%2Fghosttyold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptocode%2Fghosttyold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptocode%2Fghosttyold/lists"}