diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index c295372..9f92160 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -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 @@ -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 diff --git a/homeConfigurations/profiles/common_tmux.nix b/homeConfigurations/profiles/common_tmux.nix index bcfaa6d..8703ebf 100644 --- a/homeConfigurations/profiles/common_tmux.nix +++ b/homeConfigurations/profiles/common_tmux.nix @@ -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 diff --git a/tests/tmux.bats b/tests/tmux.bats index 15b6ede..10af3bf 100755 --- a/tests/tmux.bats +++ b/tests/tmux.bats @@ -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" ] @@ -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)" ] +}