Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to AI coding agents working on this repository.

## What This Is

A GitHub repo ([dmythro/terminal-setup](https://github.com/dmythro/terminal-setup)) containing a one-command macOS terminal setup script. Designed to be run via `curl | bash` on a fresh Mac.
A GitHub repo ([dmythro/terminal-setup](https://github.com/dmythro/terminal-setup)) containing a one-command macOS / Linux terminal setup script. Designed to be run via `curl | bash` on a fresh Mac or Linux machine (Ubuntu/Debian).

## Files

Expand All @@ -16,13 +16,17 @@ A GitHub repo ([dmythro/terminal-setup](https://github.com/dmythro/terminal-setu

## Script Structure

The script uses `set -e` and is sequential with interactive prompts (`read -p`). It writes config files inline using **quoted heredocs** (`cat > ~/.file << 'TAG'`) so variables aren't expanded during write. The tmux toggle uses a `__TMUX_TOGGLE__` placeholder in the zshrc heredoc, replaced via `sed -i ''` after writing — this is the only value that needs post-write substitution.
The script uses `set -e` and is sequential with interactive prompts (`read -p`). It writes config files inline using **quoted heredocs** (`cat > ~/.file << 'TAG'`) so variables aren't expanded during write. Two placeholders need post-write substitution: `__TMUX_TOGGLE__` in the zshrc and `__CLIPBOARD_CMD__` in the tmux.conf, both replaced via the `sed_inplace` helper.

`REPO_RAW` (line 9) is used to download `Dmythro.terminal` from the repo at runtime (section 11).
**OS detection** uses `uname -s` to set `IS_MACOS`/`IS_LINUX` booleans at the top. macOS uses Homebrew for packages; Linux (Ubuntu/Debian) uses apt, with curl installers for packages not in apt (starship, bun) and a git clone for zsh-completions. The `sed_inplace()` helper wraps `sed -i ''` (BSD) vs `sed -i` (GNU) — it's the only helper function needed.

Key sections: Homebrew install → core packages (incl. zsh-completions) → optional tmux → optional dev tools (incl. zoxide, delta) → optional AI coding agents → fzf keybindings → delta git config → tmux.conf → .zshrc → starship.toml → Terminal.app profile import → summary output.
`REPO_RAW` (line 9) is used to download `Dmythro.terminal` from the repo at runtime (section 12, macOS only).

`reset-terminal.sh` mirrors this structure with per-section interactive prompts. It replaces `~/.zshrc` with a minimal version (preserving Homebrew/local bin paths) rather than deleting it outright. Packages are left installed by default since they're inert without configs.
Key sections: Homebrew install (macOS only) → core packages → optional tmux → optional dev tools (incl. zoxide, delta) → optional AI coding agents → fzf keybindings (macOS only) → delta git config → tmux.conf → .zshrc → starship.toml → Nerd Font → Terminal.app profile import (macOS only) → summary output.

The `.zshrc` is cross-platform — it detects paths at runtime (e.g. `[[ -f /opt/homebrew/bin/brew ]]`) rather than using OS-specific placeholders for plugin paths. Autosuggestions, syntax highlighting, and fzf are sourced from whichever path exists (Homebrew or `/usr/share`).

`reset-terminal.sh` mirrors this structure with per-section interactive prompts. It replaces `~/.zshrc` with a minimal version (preserving Homebrew/local bin paths) rather than deleting it outright. Packages are left installed by default since they're inert without configs. On Linux, it removes apt packages and git-cloned zsh-completions.

## Conventions

Expand All @@ -31,6 +35,8 @@ Key sections: Homebrew install → core packages (incl. zsh-completions) → opt
- The summary is conditional — only shows sections for packages the user chose to install
- The script is destructive — it overwrites `~/.zshrc`, `~/.tmux.conf`, and `~/.config/starship.toml` without backup. Don't test on a machine with configs you want to keep.
- AI coding agent prompts default to Y for OpenCode and Claude Code, N for the rest
- Terminal.app profile import (section 12) is macOS-only — silently skipped on Linux
- Nerd Font install uses `brew --cask` on macOS, downloads from GitHub releases on Linux

## Terminal Profile Notes

Expand All @@ -49,4 +55,4 @@ No AI agents are installed or prompted during setup. The final summary lists all
- **Gemini CLI** (`brew install gemini-cli`) — Google, open source
- **Aider** (`brew install aider`) — multi-model pair programming

The reset script still handles both formula and cask uninstalls for agents that were installed manually.
The reset script still handles both formula and cask uninstalls for agents that were installed manually (macOS). On Linux, the reset script removes apt packages, git-cloned zsh-completions, and optionally bun and Nerd Fonts.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Terminal Setup

A curated one-command macOS terminal setup for **zsh** and the native **Terminal.app**. Installs a fast, modern shell environment with sensible defaults — optimized for speed and AI coding agents.
A curated one-command macOS & Linux terminal setup for **zsh**. Installs a fast, modern shell environment with sensible defaults — optimized for speed and AI coding agents.

While it includes an optional Terminal.app dark theme profile, the shell configuration works in **any terminal emulator** — [iTerm2](https://iterm2.com), [Ghostty](https://ghostty.org), [Alacritty](https://alacritty.org), [Kitty](https://sw.kovidez.net/kitty/), [WezTerm](https://wezfurlong.org/wezterm/), VS Code integrated terminal, etc. The zsh config, prompt, and plugins are terminal-agnostic.
Uses **Homebrew** on macOS and **apt** on Linux (Ubuntu/Debian). The shell configuration works in **any terminal emulator** — Terminal.app, [iTerm2](https://iterm2.com), [Ghostty](https://ghostty.org), [Alacritty](https://alacritty.org), [Kitty](https://sw.kovidez.net/kitty/), [WezTerm](https://wezfurlong.org/wezterm/), GNOME Terminal, VS Code integrated terminal, etc. The zsh config, prompt, and plugins are terminal-agnostic.

## Quick Start

Expand All @@ -22,7 +22,7 @@ curl -sL https://raw.githubusercontent.com/dmythro/terminal-setup/main/reset-ter

| Package | What it does |
|---------|-------------|
| [Homebrew](https://brew.sh) | macOS package manager (installed if missing) |
| [Homebrew](https://brew.sh) / apt | macOS package manager (Linux uses apt) |
| [fzf](https://github.com/junegunn/fzf) | Fuzzy finder — `Ctrl+R` for history, `Ctrl+T` for files |
| [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) | Fish-like ghost text suggestions from history |
| [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) | Commands turn green/red as you type |
Expand All @@ -48,7 +48,7 @@ Plus a hand-tuned `~/.zshrc` with:
Includes a mouse-friendly `~/.tmux.conf`:

- Auto-starts per terminal session (toggle with `USE_TMUX=false` in `~/.zshrc`)
- **Mouse support**: drag to copy (goes to macOS clipboard), drag borders to resize, scroll
- **Mouse support**: drag to copy (goes to system clipboard), drag borders to resize, scroll
- `Prefix + \|` / `Prefix + -` for vertical/horizontal splits
- `Prefix + hjkl` for pane navigation (arrow keys unbound to avoid zsh conflicts)
- `Prefix + HJKL` for pane resizing
Expand Down Expand Up @@ -79,7 +79,7 @@ The setup includes an optional section for installing AI coding agent CLIs via H

> Each agent requires its own API key or login. See the respective docs for setup.

### Optional — Terminal.app Profile
### Optional — Terminal.app Profile (macOS only)

A dark theme profile (`Dmythro.terminal`) imported directly into Terminal.app:

Expand Down Expand Up @@ -121,26 +121,28 @@ To get the most out of Starship's icons and glyphs on macOS 26, use a [Nerd Font

> **Note:** Terminal.app on macOS 26 only renders `calt` (contextual alternates) — it does not support `liga`/`dlig` ligatures. For full ligature rendering, use [iTerm2](https://iterm2.com), [Kitty](https://sw.kovidgoyal.net/kitty/), or [WezTerm](https://wezfurlong.org/wezterm/).

| Font | By | Ligatures | Box Drawing | Install |
|------|----|:---------:|:-----------:|---------|
| [Geist Mono](https://www.programmingfonts.org/#geistmono) | Vercel | Yes (SS11) | Partial | `brew install --cask font-geist-mono-nerd-font` |
| [Cascadia Code](https://www.programmingfonts.org/#cascadiacode) | Microsoft | Yes | Complete | `brew install --cask font-caskaydia-mono-nerd-font` |
| [Monaspace](https://monaspace.githubnext.com) | GitHub | Yes | Complete | `brew install --cask font-monaspice-nerd-font` |
| [Iosevka](https://www.programmingfonts.org/#iosevka) | Belleve Invis | Yes | Complete | `brew install --cask font-iosevka-nerd-font` |
| Font | By | Ligatures | Box Drawing | Install (macOS) | Install (Linux) |
|------|----|:---------:|:-----------:|---------|---------|
| [Geist Mono](https://www.programmingfonts.org/#geistmono) | Vercel | Yes (SS11) | Partial | `brew install --cask font-geist-mono-nerd-font` | [GeistMono.tar.xz](https://github.com/ryanoasis/nerd-fonts/releases/latest/download/GeistMono.tar.xz) |
| [Cascadia Code](https://www.programmingfonts.org/#cascadiacode) | Microsoft | Yes | Complete | `brew install --cask font-caskaydia-mono-nerd-font` | [CascadiaCode.tar.xz](https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CascadiaCode.tar.xz) |
| [Monaspace](https://monaspace.githubnext.com) | GitHub | Yes | Complete | `brew install --cask font-monaspice-nerd-font` | [Monaspace.tar.xz](https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Monaspace.tar.xz) |
| [Iosevka](https://www.programmingfonts.org/#iosevka) | Belleve Invis | Yes | Complete | `brew install --cask font-iosevka-nerd-font` | [Iosevka.tar.xz](https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Iosevka.tar.xz) |

> **Linux font install:** Download the `.tar.xz`, extract to `~/.local/share/fonts/`, then run `fc-cache -fv`. The setup script handles this automatically for Monaspace.

**Geist Mono** — ligatures are off by default; enable Stylistic Set 11 (SS11) in your terminal's font settings. Box drawing characters were added in v1.5.0 but [some intersections are missing](https://github.com/vercel/geist-font/issues/64) (e.g. `├`), causing fallback to the system font — TUI apps with tables (lazygit, btop, opencode) may show gaps at those points. **Cascadia Code** and **Monaspace** have complete box drawing and render gapless tables.

**Monaspace** — 5 variants (Neon, Argon, Xenon, Radon, Krypton) with "texture healing" for readability and variable weight support.

**Iosevka** — extremely narrow and customizable, good for small screens and split panes.

After installing, set the font in Terminal.app: **Settings > Profiles > Font > Change**.
After installing, set the font in your terminal: on macOS, **Terminal.app > Settings > Profiles > Font > Change**; on Linux, use your terminal emulator's font settings.

> Preview and compare fonts at [programmingfonts.org](https://www.programmingfonts.org).

## Why This Setup

Setting up a productive terminal on a fresh Mac takes time. This script does it in one command with interactive prompts — no frameworks, no plugin managers, no bloat. Just Homebrew packages and plain config files.
Setting up a productive terminal on a fresh Mac or Linux machine takes time. This script does it in one command with interactive prompts — no frameworks, no plugin managers, no bloat. Just Homebrew packages and plain config files.

The zsh configuration is optimized for working with AI coding agents:

Expand Down Expand Up @@ -178,7 +180,7 @@ curl -sL https://raw.githubusercontent.com/dmythro/terminal-setup/main/reset-ter

- [ ] Interactive TUI installer via `npx` / `bunx` (checkboxes, step previews, config presets)
- [ ] Profile presets (minimal, full, agent-focused)
- [ ] Linux support
- [x] Linux support (Ubuntu/Debian via apt)
- [ ] Dotfile backup before overwriting

## License
Expand Down
Loading