Repository Analysis

ghostty-org/ghostty

👻 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration.

2.7 Likely human-written View on GitHub
2.7
Adjusted Score
2.7
Raw Score
100%
Time Factor
2026-05-30
Last Push
55,565
Stars
Zig
Language
88,508
Lines of Code
423
Files
206
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 3MEDIUM 13LOW 190

Pattern Findings

206 matches across 12 categories. Click a row to expand file-level details.

Over-Commented Block175 hits · 164 pts
SeverityFileLineSnippet
LOWCMakeLists.txt1# CMake wrapper for libghostty-vt
LOWCMakeLists.txt21#
LOWCMakeLists.txt41# Option 2 — find_package (after installing to a prefix):
LOWCMakeLists.txt61#
LOWCMakeLists.txt261# Zig target triple. For native builds, use the IMPORTED targets above
LOWmacos/GhosttyUITests/GhosttyCustomConfigCase.swift1//
LOWmacos/Tests/BenchmarkTests.swift1//
LOWmacos/Tests/Terminal/TerminalRestorableTests.swift41 @MainActor
LOWmacos/Tests/Terminal/TerminalRestorableTests.swift61 #expect(v5.surfaceTree.contains(where: { $0.id.uuidString == "926F3F2A-824C-40C9-87CA-2CDCA4E11049" }))
LOWmacos/Tests/Terminal/TerminalRestorableTests.swift81 #expect(v7.effectiveFullscreenMode == .native)
LOWmacos/Sources/App/macOS/ghostty-bridging-header.h1// C imports here are exposed to Swift.
LOWmacos/Sources/App/macOS/AppDelegate.swift181 // Disable the automatic full screen menu item because we handle
LOWmacos/Sources/App/macOS/AppDelegate.swift461 // In the future I have ideas about making this more fine-grained if
LOWmacos/Sources/Features/AppleScript/ScriptTerminal.swift1import AppKit
LOWmacos/Sources/Features/AppleScript/ScriptTab.swift1import AppKit
LOWmacos/Sources/Features/AppleScript/ScriptWindow.swift1import AppKit
LOWmacos/Sources/Features/AppleScript/ScriptWindow.swift21 /// Canonical representative for this scripting window's tab group.
LOW…ces/Features/AppleScript/AppDelegate+AppleScript.swift1import AppKit
LOW…ces/Features/AppleScript/AppDelegate+AppleScript.swift21 /// Backing collection for `application.windows`.
LOW…cos/Sources/Features/Terminal/TerminalController.swift441 // If our parent tab group already has this window, macOS added it and
LOW…cos/Sources/Features/Terminal/TerminalController.swift1101 }
LOW…Sources/Features/Terminal/BaseTerminalController.swift1import Cocoa
LOW…Sources/Features/Terminal/BaseTerminalController.swift1021
LOW…al/Window Styles/TitlebarTabsTahoeTerminalWindow.swift121 guard let oldValue else { return }
LOW…os/Sources/Features/App Intents/IntentPermission.swift1import AppKit
LOW…s/Features/QuickTerminal/QuickTerminalController.swift481 // Now that the window is visible, sync our appearance. This function
LOWmacos/Sources/Features/Splits/SplitView.swift1import SwiftUI
LOWmacos/Sources/Features/Splits/SplitTree.swift241
LOWmacos/Sources/Features/Splits/SplitTree.swift501 ///
LOWmacos/Sources/Features/Splits/SplitTree.swift821 /// to 2D coordinate space. The coordinate system uses (0,0) as the top-left corner with
LOWmacos/Sources/Features/Splits/SplitTree.swift841 /// //
LOWmacos/Sources/Features/Splits/SplitTree.swift861 height = Double(h)
LOWmacos/Sources/Features/Splits/SplitTree.swift881 /// - **Vertical splits**: Width = max of children widths, Height = sum of children heights
LOWmacos/Sources/Features/Splits/SplitTree.swift921 /// This method recursively traverses the split tree and calculates the precise bounds
LOWmacos/Sources/Features/Splits/SplitTree.swift1001
LOWmacos/Sources/Features/Splits/SplitTree.swift1361 /// - The tree's hierarchical structure (splits and their directions)
LOWmacos/Sources/Helpers/ExpiringUndoManager.swift1/// An UndoManager subclass that supports registering undo operations that automatically expire after a specified durati
LOWmacos/Sources/Helpers/ExpiringUndoManager.swift81 // but we want to make sure it happens right now.
LOWmacos/Sources/Helpers/NonDraggableHostingView.swift1import SwiftUI
LOWmacos/Sources/Helpers/Extensions/NSMenu+Extension.swift1import AppKit
LOW…/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift821 owner: self,
LOW…/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift1141 // grabbed it and do nothing.
LOW…/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift1241 /// Concretely: Command+Period will do: performKeyEquivalent, doCommand ("cancel:"). In doCommand,
LOW…/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift1921
LOW…/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift2101 // we must return the responder capable of handling the COMBINATION of those send
LOW…s/Sources/Ghostty/Surface View/SurfaceScrollView.swift1import SwiftUI
LOW…s/Sources/Ghostty/Surface View/SurfaceScrollView.swift281 guard row != lastSentRow else { return }
LOW…s/Sources/Ghostty/Surface View/SurfaceScrollView.swift301 return
LOW…s/Sources/Ghostty/Surface View/SurfaceScrollView.swift321 ///
LOWmacos/Sources/Ghostty/Surface View/SurfaceView.swift581 }
LOWnix/build-support/check-zig-cache.sh1#!/usr/bin/env bash
LOWinclude/ghostty.h1// Ghostty embedding API. The documentation for the embedding API is
LOWinclude/ghostty.h21typedef SSIZE_T ssize_t;
LOWinclude/ghostty.h41 #ifdef GHOSTTY_BUILD_SHARED
LOWinclude/ghostty/vt.h121extern "C" {
LOWinclude/ghostty/vt.h141#include <ghostty/vt/modes.h>
LOWinclude/ghostty/vt/device.h21#define GHOSTTY_DA_CONFORMANCE_VT220 62
LOWinclude/ghostty/vt/device.h41#define GHOSTTY_DA_FEATURE_NATIONAL_REPLACEMENT 9
LOWinclude/ghostty/vt/types.h1/**
LOWinclude/ghostty/vt/types.h21#if defined(GHOSTTY_STATIC)
115 more matches not shown…
Self-Referential Comments7 hits · 26 pts
SeverityFileLineSnippet
MEDIUMinclude/ghostty/vt/terminal.h85 * ### Defining a write_pty callback
MEDIUMinclude/ghostty/vt/terminal.h88 * ### Defining a bell callback
MEDIUMinclude/ghostty/vt/terminal.h91 * ### Defining a title_changed callback
MEDIUMinclude/ghostty/vt/sys.h33 * ### Defining a PNG decode callback
MEDIUMsrc/shell-integration/bash/bash-preexec.sh135# This function is installed as part of the PROMPT_COMMAND;
MEDIUMsrc/shell-integration/bash/bash-preexec.sh143# This function is installed as part of the PROMPT_COMMAND.
MEDIUMsrc/shell-integration/bash/bash-preexec.sh203# This function is installed as the DEBUG trap. It is invoked before each
Synthetic Comment Markers2 hits · 15 pts
SeverityFileLineSnippet
HIGH…cos/Sources/Features/Terminal/TerminalController.swift1703 // Initial size as requested by the configuration (e.g. `window-width`)
HIGH…os/Sources/Helpers/Extensions/NSScreen+Extension.swift57 /// - Returns: CGPoint suitable for setFrameOrigin that positions the window as requested
Decorative Section Separators3 hits · 9 pts
SeverityFileLineSnippet
MEDIUMCMakeLists.txt12# ---------------------------------
MEDIUMCMakeLists.txt23# ---------------------------------------------
MEDIUMCMakeLists.txt48# -------------------
AI Slop Vocabulary3 hits · 8 pts
SeverityFileLineSnippet
MEDIUM…cos/Sources/Features/Terminal/TerminalController.swift493 // is used in the tab bar. This fixes that. If we can find a more robust
MEDIUMmacos/Sources/Features/Splits/SplitTree.swift617 // be robust against it.
LOWnix/build-support/fetch-zig-cache.sh8# at all and packagers can just use `zig build --fetch`.
Fake / Example Data4 hits · 4 pts
SeverityFileLineSnippet
LOWmacos/GhosttyUITests/GhosttyMouseStateTests.swift16 let lines = (1...200).map { "Line \($0): The quick brown fox jumps over the lazy dog. Lorem ipsum dolor sit amet
LOWmacos/GhosttyUITests/GhosttyMouseStateTests.swift16 let lines = (1...200).map { "Line \($0): The quick brown fox jumps over the lazy dog. Lorem ipsum dolor sit amet
LOWsrc/cli/lorem_ipsum.txt1Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras hendrerit aliquet
LOWsrc/cli/lorem_ipsum.txt1Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras hendrerit aliquet
Deep Nesting4 hits · 4 pts
SeverityFileLineSnippet
LOWsrc/font/nerd_font_codegen.py304
LOWsrc/font/nerd_font_codegen.py414
LOWsrc/font/nerd_font_codegen.py95
LOWsrc/font/nerd_font_codegen.py156
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippet
LOWmacos/Sources/Features/Splits/SplitTree.swift1369 /// Example usage:
LOWmacos/Sources/Helpers/ExpiringUndoManager.swift6/// Example usage:
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMinclude/ghostty/vt/wasm.h33 * Here's a simple example of using the Wasm utilities with the key encoder:
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippet
LOWsrc/shell-integration/bash/ghostty.bash99 # Check if argument is '-e' or '--edit' (sudoedit flags)
LOWsrc/shell-integration/bash/ghostty.bash104 # Check if argument is neither an option nor a key-value pair
Cross-Language Confusion1 hit · 2 pts
SeverityFileLineSnippet
HIGHsrc/font/nerd_font_codegen.py576 f.write("\n else => null,\n };\n}\n")
Hyper-Verbose Identifiers2 hits · 2 pts
SeverityFileLineSnippet
LOWsrc/font/nerd_font_codegen.py203def coalesce_codepoints_to_ranges(codepoints: list[int]) -> list[tuple[int, int]]:
LOWsrc/font/nerd_font_codegen.py304def generate_codepoint_tables(