Saltar a contenido

Ghostty - Terminal Emulator

*Ultima referencia Ghostty para atajos, configuración y características de productividad *

"Clase de la hoja"

########################################################################################################################################################################################################################################################## Copiar todos los comandos
########################################################################################################################################################################################################################################################## Generar PDF seleccionado/button

■/div titulada

Ghostty es un emulador terminal rápido, rico en características y multiplataforma creado por Mitchell Hashimoto, cofundador de HashiCorp. Construido con Zig y diseñado para el rendimiento, Ghostty utiliza la aceleración UI nativa de plataforma y GPU para ofrecer una experiencia terminal excepcional. Esta hoja de trampa completa cubre atajos esenciales, opciones de configuración y funciones avanzadas para maximizar su productividad con Ghostty.

Comienzo

Instalación

# macOS - Download from official website
# Ready-to-run binaries available at https://ghostty.org/

# Linux - Build from source
git clone https://github.com/ghostty-org/ghostty.git
cd ghostty
zig build -Doptimize=ReleaseFast

# Check installation
ghostty --version

# List default keybindings
ghostty +list-keybinds --default

Primer lanzamiento

# Launch Ghostty
ghostty

# Launch with specific configuration
ghostty --config-file=/path/to/config

# Launch in debug mode
ghostty --debug

# Launch with specific working directory
ghostty --working-directory=/path/to/dir

Atajos de teclado esenciales

Gestión de ventana

# New window
Cmd+N (macOS) / Ctrl+Shift+N (Linux)

# Close window
Cmd+W (macOS) / Ctrl+Shift+W (Linux)

# Close all windows (macOS only)
Cmd+Option+W

# Toggle fullscreen
Cmd+Enter (macOS) / F11 (Linux)

# Toggle window decorations (Linux only)
Ctrl+Shift+F12

# Minimize window
Cmd+M (macOS)

# Hide all windows (macOS only)
Cmd+H

Tab Management

# New tab
Cmd+T (macOS) / Ctrl+Shift+T (Linux)

# Close tab
Cmd+W (macOS) / Ctrl+Shift+W (Linux)

# Next tab
Cmd+Shift+] (macOS) / Ctrl+Page Down (Linux)

# Previous tab
Cmd+Shift+[ (macOS) / Ctrl+Page Up (Linux)

# Go to last tab
Cmd+9 (macOS) / Ctrl+9 (Linux)

# Go to specific tab (1-9)
Cmd+1-8 (macOS) / Ctrl+1-8 (Linux)

# Move tab left/right
Cmd+Shift+Left/Right (macOS)

# Toggle tab overview (libadwaita)
Ctrl+Shift+Tab

Gestión dividida

# New split (right)
Cmd+D (macOS) / Ctrl+Shift+D (Linux)

# New split (down)
Cmd+Shift+D (macOS) / Ctrl+Shift+Down (Linux)

# New split (auto direction)
Cmd+Shift+Enter

# Focus split (directional)
Cmd+Option+Arrow (macOS) / Ctrl+Alt+Arrow (Linux)

# Focus next split
Cmd+] (macOS) / Ctrl+Shift+] (Linux)

# Focus previous split
Cmd+[ (macOS) / Ctrl+Shift+[ (Linux)

# Zoom/unzoom current split
Cmd+Shift+Z (macOS) / Ctrl+Shift+Z (Linux)

# Resize split
Cmd+Shift+Arrow (macOS) / Ctrl+Shift+Alt+Arrow (Linux)

# Equalize all splits
Cmd+Shift+E (macOS) / Ctrl+Shift+E (Linux)

# Close split
Cmd+W (macOS) / Ctrl+Shift+W (Linux)

Operaciones de texto

Copiar y Pegar

# Copy selection
Cmd+C (macOS) / Ctrl+Shift+C (Linux)

# Paste from clipboard
Cmd+V (macOS) / Ctrl+Shift+V (Linux)

# Paste from selection (Linux)
Shift+Insert

# Copy URL under cursor
Cmd+Shift+U (macOS) / Ctrl+Shift+U (Linux)

# Select all
Cmd+A (macOS) / Ctrl+Shift+A (Linux)

Selección de texto

# Start selection mode
Cmd+Shift+X (macOS) / Ctrl+Shift+X (Linux)

# Select word
Double-click

# Select line
Triple-click

# Extend selection
Shift+Arrow keys

# Adjust selection
Shift+Arrow (left, right, up, down)
Shift+Page Up/Down (page selection)
Shift+Home/End (line selection)

Búsqueda y navegación

# Search in terminal
Cmd+F (macOS) / Ctrl+Shift+F (Linux)

# Find next
Cmd+G (macOS) / F3 (Linux)

# Find previous
Cmd+Shift+G (macOS) / Shift+F3 (Linux)

# Jump to prompt (forward/backward)
Cmd+Up/Down (macOS) / Ctrl+Shift+Up/Down (Linux)

Fuente y pantalla

Control de tamaño de la fuente

# Increase font size
Cmd+Plus (macOS) / Ctrl+Plus (Linux)

# Decrease font size
Cmd+Minus (macOS) / Ctrl+Minus (Linux)

# Reset font size
Cmd+0 (macOS) / Ctrl+0 (Linux)

Control de pantalla

# Clear screen
Cmd+K (macOS) / Ctrl+Shift+K (Linux)

# Clear screen and scrollback
Cmd+Shift+K (macOS) / Ctrl+Shift+L (Linux)

# Reset terminal
Cmd+R (macOS) / Ctrl+Shift+R (Linux)

# Scroll to top
Cmd+Home (macOS) / Ctrl+Home (Linux)

# Scroll to bottom
Cmd+End (macOS) / Ctrl+End (Linux)

# Scroll page up/down
Page Up/Page Down

# Scroll line up/down
Shift+Up/Down

Características avanzadas

Terminal rápido

# Toggle quick terminal (macOS only)
Cmd+` (backtick)

# Global quick terminal (works when Ghostty not focused)
# Configure with: keybind = global:cmd+grave_accent=toggle_quick_terminal

# Quick terminal features:
# - Slides in from screen edge
# - Disappears when focus lost
# - Preserves terminal state
# - Supports splits (no tabs)
# - Singleton instance

Inspector y Debugging

# Toggle terminal inspector
Cmd+I (macOS) / Ctrl+Shift+I (Linux)

# Show inspector
Cmd+Shift+I (macOS)

# Hide inspector
Cmd+Option+I (macOS)

# Inspector features:
# - View terminal state
# - Debug rendering issues
# - Monitor performance
# - Inspect escape sequences

Configuration Management

# Open configuration file
Cmd+, (macOS) / Ctrl+, (Linux)

# Reload configuration
Cmd+Shift+R (macOS) / Ctrl+Shift+F5 (Linux)

# Configuration locations:
# macOS: ~/.config/ghostty/config
# Linux: ~/.config/ghostty/config
# Windows: %APPDATA%\ghostty\config

Ejemplos de configuración

Configuración básica

# ~/.config/ghostty/config

# Font settings
font-family = "JetBrains Mono"
font-size = 14
font-weight = normal

# Window settings
window-width = 120
window-height = 30
window-padding-x = 10
window-padding-y = 10

# Theme
theme = "catppuccin-mocha"
background-opacity = 0.95

# Cursor
cursor-style = block
cursor-style-blink = true

# Shell
shell-integration = true
shell-integration-features = cursor,sudo,title

Llaves personalizadas

# Custom keybindings
keybind = cmd+shift+enter=new_split:auto
keybind = cmd+shift+h=new_split:left
keybind = cmd+shift+j=new_split:down
keybind = cmd+shift+k=new_split:up
keybind = cmd+shift+l=new_split:right

# Vim-style split navigation
keybind = cmd+h=goto_split:left
keybind = cmd+j=goto_split:down
keybind = cmd+k=goto_split:up
keybind = cmd+l=goto_split:right

# Quick terminal with custom key
keybind = global:cmd+grave_accent=toggle_quick_terminal

# Text operations
keybind = cmd+shift+c=copy_to_clipboard
keybind = cmd+shift+v=paste_from_clipboard
keybind = cmd+shift+u=copy_url_to_clipboard

Configuración avanzada

# Performance settings
gpu-acceleration = true
renderer = auto

# Terminal behavior
scrollback-limit = 10000
mouse-hide-while-typing = true
confirm-close-surface = false

# Shell integration
shell-integration = true
shell-integration-features = cursor,sudo,title,jump

# Quick terminal settings
quick-terminal = true
quick-terminal-position = top
quick-terminal-screen = main
quick-terminal-animation-duration = 200

# Security
secure-input = false

# Appearance
window-decoration = true
window-theme = auto
macos-non-native-fullscreen = false

Temas y personalización

Temas incorporados

# Popular built-in themes
theme = "catppuccin-mocha"
theme = "dracula"
theme = "gruvbox-dark"
theme = "nord"
theme = "solarized-dark"
theme = "tokyo-night"
theme = "one-dark"

# List all available themes
ghostty +list-themes

# Preview themes (in theme preview interface)
# Press 'c' to copy theme name
# Press '?' for keybinding help

Esquemas de color personalizado

# Custom colors
background = #1e1e2e
foreground = #cdd6f4
cursor-color = #f5e0dc

# Normal colors
palette = 0=#45475a
palette = 1=#f38ba8
palette = 2=#a6e3a1
palette = 3=#f9e2af
palette = 4=#89b4fa
palette = 5=#f5c2e7
palette = 6=#94e2d5
palette = 7=#bac2de

# Bright colors
palette = 8=#585b70
palette = 9=#f38ba8
palette = 10=#a6e3a1
palette = 11=#f9e2af
palette = 12=#89b4fa
palette = 13=#f5c2e7
palette = 14=#94e2d5
palette = 15=#a6adc8

Consejos de productividad

Optimización del flujo de trabajo

# Use splits for multiple tasks
# Cmd+D for vertical split
# Cmd+Shift+D for horizontal split
# Navigate with Cmd+Option+Arrow

# Quick terminal for temporary tasks
# Cmd+` to toggle
# Perfect for quick commands without opening new window

# Shell integration features
# Automatic title updates
# Sudo password prompts
# Command completion
# Jump between prompts

Operaciones de archivo

# Write scrollback to file
# Configure with: keybind = cmd+shift+s=write_scrollback_file:paste
# Options: paste, open

# Write screen contents
# keybind = cmd+shift+o=write_screen_file:open

# Write selection to file
# keybind = cmd+shift+w=write_selection_file:paste

Gestión del período de sesiones

# Save and restore sessions (via shell integration)
# Automatic working directory restoration
# Command history preservation
# Environment variable restoration

# Use tmux/screen for persistent sessions
# Ghostty integrates well with terminal multiplexers
# Shell integration works with tmux/screen

Solución de problemas

Cuestiones comunes

# Terminal appears broken
# Use reset action: Cmd+R (macOS) / Ctrl+Shift+R (Linux)

# Font rendering issues
# Check GPU acceleration: gpu-acceleration = true/false
# Try different renderer: renderer = auto/software/opengl

# Performance issues
# Reduce scrollback: scrollback-limit = 1000
# Disable animations: quick-terminal-animation-duration = 0
# Check GPU acceleration settings

# Configuration not loading
# Check config file location
# Reload config: Cmd+Shift+R (macOS) / Ctrl+Shift+F5 (Linux)
# Check logs for errors

Debug Commands

# Enable debug logging
ghostty --debug

# List all keybindings
ghostty +list-keybinds

# List default keybindings
ghostty +list-keybinds --default

# List available themes
ghostty +list-themes

# Check configuration
ghostty +validate-config

# Version information
ghostty --version

Características de plataforma-específico

MacOS Características

# Native macOS integration
# - Touch Bar support
# - macOS notifications
# - System appearance integration
# - Secure input mode
# - Quick terminal global access

# macOS-specific shortcuts
Cmd+H                    # Hide all windows
Cmd+Option+W            # Close all windows
Cmd+M                   # Minimize window
Cmd+`                   # Quick terminal

# macOS configuration
macos-non-native-fullscreen = false
macos-option-as-alt = true
macos-titlebar-style = transparent

Características de Linux

# Linux-specific features
# - Wayland and X11 support
# - libadwaita integration
# - System theme integration
# - Window decoration control

# Linux-specific shortcuts
Ctrl+Shift+F12          # Toggle window decorations
F11                     # Toggle fullscreen
Ctrl+Shift+Tab          # Tab overview (libadwaita)

# Linux configuration
linux-cgroup = v2
wayland-app-id = com.mitchellh.ghostty
x11-instance-name = ghostty

Integración y automatización

Integración Shell

# Enable shell integration
shell-integration = true
shell-integration-features = cursor,sudo,title,jump

# Features:
# - cursor: Enhanced cursor positioning
# - sudo: Secure sudo password prompts
# - title: Automatic window title updates
# - jump: Jump between command prompts

Integración de herramientas externas

# Works well with:
# - tmux/screen (terminal multiplexers)
# - zsh/bash/fish (modern shells)
# - vim/neovim (text editors)
# - fzf (fuzzy finder)
# - ripgrep/ag (search tools)

# Example fzf integration
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'

# Example with ripgrep
alias rg='rg --color=always --line-number --no-heading --smart-case'

Optimización del rendimiento

GPU Aceleración

# Enable GPU acceleration
gpu-acceleration = true
renderer = auto

# Renderer options:
# - auto: Automatic selection
# - software: CPU rendering
# - opengl: OpenGL rendering
# - metal: Metal rendering (macOS)
# - vulkan: Vulkan rendering (Linux)

Gestión de memoria

# Optimize memory usage
scrollback-limit = 10000
image-storage-limit = 320000000

# Reduce memory footprint
background-opacity = 1.0  # Disable transparency
cursor-style-blink = false  # Disable cursor blinking

Startup Performance

# Fast startup
window-save-state = never
restore-state = false

# Minimal configuration for speed
theme = builtin
font-family = monospace

Características de seguridad

Modo de entrada seguro

# Toggle secure input (macOS only)
# Prevents other apps from monitoring input
# Useful for passwords and sensitive data
# Must be manually toggled off

# Configure secure input
secure-input = false  # Default state

Seguridad de configuración

# Protect configuration file
chmod 600 ~/.config/ghostty/config

# Use environment variables for sensitive data
# Instead of hardcoding in config file
shell-integration-features = $\\{GHOSTTY_FEATURES\\}

Interfaz de línea de mando

Comandos básicos

# Launch options
ghostty                                    # Default launch
ghostty --help                            # Show help
ghostty --version                         # Show version
ghostty --config-file=/path/to/config     # Custom config
ghostty --working-directory=/path         # Set working directory

# Utility commands
ghostty +list-keybinds                    # List all keybindings
ghostty +list-keybinds --default          # List default keybindings
ghostty +list-themes                      # List available themes
ghostty +validate-config                  # Validate configuration

Advanced CLI Usage

# Debug and development
ghostty --debug                           # Enable debug logging
ghostty --log-level=trace                 # Set log level
ghostty --renderer=software               # Force software rendering

# Profile and benchmark
ghostty --profile                         # Enable profiling
ghostty --benchmark                       # Run benchmarks

# Testing and development
ghostty --test-config                     # Test configuration
ghostty --dry-run                         # Validate without launching