Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 20 additions & 2 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,26 @@ nix build .#nixosConfigurations.floki.config.system.build.toplevel
nix build .#homeConfigurations.jaime.activationPackage
```

### Applying Configuration Changes

When making changes to Nix configuration files, Claude can rebuild and
apply the configuration directly:

```bash
# Rebuild Darwin configuration (requires sudo)
sudo darwin-rebuild switch --flake .#jaime -L

# Reload tmux configuration without restarting
tmux source-file ~/.config/tmux/tmux.conf

# Or restart tmux server entirely (kills all sessions!)
tmux kill-server
```

**Note:** After rebuilding, tmux config is automatically updated at
`~/.config/tmux/tmux.conf`. Use `tmux source-file` to reload without
losing sessions, or restart tmux if needed.

## Git Configuration Strategy

The repository uses conditional git includes based on repository
Expand Down Expand Up @@ -479,5 +499,3 @@ nix-daemon is running on remote.

Run garbage collection: `nix-collect-garbage -d` (add `sudo` for
system-wide on NixOS)

- Add a name I can refer to or number to each of the issues in my to-do.md
8 changes: 8 additions & 0 deletions homeConfigurations/profiles/common_tmux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@
programs.tmux.extraConfig = ''
set-option -g set-clipboard on

# Allow passthrough of escape sequences (OSC 8 hyperlinks, etc.)
set-option -g allow-passthrough on

# Enable OSC 8 hyperlinks - allows clickable links in terminal
# With mouse mode on, use Cmd+Shift+click (macOS) or Ctrl+Shift+click (Linux)
# Requires tmux 3.4+ and server restart (tmux kill-server) after config change
set -as terminal-features ",*:hyperlinks"

# Auto-rename window to current folder name
set-option -g status-interval 1
set-option -g automatic-rename on
Expand Down
56 changes: 56 additions & 0 deletions tests/tmux.bats
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ get_window_option() {
[ "$result" = "on" ]
}

@test "allow-passthrough is on for clickable links" {
result=$(get_option "allow-passthrough")
[ "$result" = "on" ]
}

@test "terminal-features includes hyperlinks for OSC 8 links" {
result=$(tmux show-options -g "terminal-features" 2>/dev/null)
[[ "$result" == *"hyperlinks"* ]]
}

@test "monitor-activity is on" {
result=$(get_option "monitor-activity")
[ "$result" = "on" ]
Expand Down Expand Up @@ -269,3 +279,49 @@ get_window_option() {
git -C "$TEST_REPO" branch -D "$WORKTREE_NAME" 2>/dev/null || true
rm -rf "$TEST_REPO"
}

# Session restore tests (resurrect + continuum plugins)

@test "resurrect plugin: capture-pane-contents is on" {
result=$(tmux show-options -g "@resurrect-capture-pane-contents" 2>/dev/null | sed 's/^@resurrect-capture-pane-contents //')
[ "$result" = "on" ]
}

@test "continuum plugin: restore is on" {
result=$(tmux show-options -g "@continuum-restore" 2>/dev/null | sed 's/^@continuum-restore //')
[ "$result" = "on" ]
}

@test "continuum plugin: save-interval is 10 minutes" {
result=$(tmux show-options -g "@continuum-save-interval" 2>/dev/null | sed 's/^@continuum-save-interval //')
[ "$result" = "10" ]
}

@test "resurrect plugin: save binding exists (prefix + Ctrl-s)" {
run tmux list-keys
[ "$status" -eq 0 ]
[[ "$output" == *"C-s"* ]]
}

@test "resurrect plugin: restore binding exists (prefix + Ctrl-r)" {
run tmux list-keys
[ "$status" -eq 0 ]
[[ "$output" == *"C-r"* ]]
}

@test "resurrect plugin: save creates resurrect file" {
# Resurrect restore only works on tmux server restart, not for individual
# killed sessions. This test verifies the save mechanism works.

RESURRECT_DIR="$HOME/.tmux/resurrect"

# Trigger resurrect save via the binding (prefix + Ctrl-s)
tmux send-keys -t "$TEST_SESSION" C-Space C-s
sleep 2 # Wait for save to complete

# Verify resurrect created a save file
[ -d "$RESURRECT_DIR" ] || skip "Resurrect directory not found"

# Check that a save file exists (last symlink or files in dir)
[ -e "$RESURRECT_DIR/last" ] || [ -n "$(ls -A "$RESURRECT_DIR" 2>/dev/null)" ]
}