aboutsummaryrefslogtreecommitdiff
path: root/claude-rules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-19 15:42:22 -0500
committerCraig Jennings <c@cjennings.net>2026-07-19 15:42:22 -0500
commitb3195e9e55e185281d4d965333b1ad4ebb2ca6ee (patch)
tree09858fe1e5afe569602ac9babc7df0b0bea9973a /claude-rules
parentbeb7f0bb76eaf0da3afd07fb8617361361556882 (diff)
downloadrulesets-b3195e9e55e185281d4d965333b1ad4ebb2ca6ee.tar.gz
rulesets-b3195e9e55e185281d4d965333b1ad4ebb2ca6ee.zip
docs(rules): use gui-open to show Craig visuals
interaction.md and desktop-capture.md told the agent to launch a viewer with google-chrome-stable ... & or hyprctl dispatch exec "imv ...". Both files already noted the failure mode: a coding-agent shell reaps an ordinary background child after it returns, so the window dies before Craig sees it. gui-open (dotfiles a34d479, on PATH) closes that. It detaches through systemd-run --user so the shell can't reap it, resolves the current Hyprland instance after a compositor restart, and confirms a mapped, visible client before returning. Both files now launch through it — gui-open <path> auto-detects image vs HTML, with --image/--browser to force. The separate-workspace guidance stays. gui-open replaces only the launch, which was the fragile part. Proposed by archsetup after shipping the tool. It's dotfiles-owned, not a rulesets script, so this is guidance only; a machine without it needs a dotfiles pull.
Diffstat (limited to 'claude-rules')
-rw-r--r--claude-rules/desktop-capture.md9
-rw-r--r--claude-rules/interaction.md2
2 files changed, 7 insertions, 4 deletions
diff --git a/claude-rules/desktop-capture.md b/claude-rules/desktop-capture.md
index 0051c4d..c4a67f9 100644
--- a/claude-rules/desktop-capture.md
+++ b/claude-rules/desktop-capture.md
@@ -38,9 +38,12 @@ output isn't available; it needs the compositor installed.
Open it on a *separate* real workspace and tell them which one, so it never
grabs their active workspace. They switch when ready. Craig's viewer preference
-is `imv`; launch it through the compositor (`hyprctl dispatch exec "imv
-<files>"`) so it survives the agent's shell rather than a bare `&` job that gets
-reaped.
+is `imv`; launch it with `gui-open --image <file>` (dotfiles-shipped) rather
+than a bare `&` job or `hyprctl dispatch exec`: it detaches through `systemd-run
+--user` so the agent shell can't reap it, resolves the current Hyprland instance
+after a compositor restart, and confirms the viewer is mapped and visible before
+returning. An HTML render uses `gui-open <file>` (or `--browser`) the same way.
+If `gui-open` isn't on PATH, the machine needs a dotfiles pull.
## Always clean up
diff --git a/claude-rules/interaction.md b/claude-rules/interaction.md
index 8d65799..dfd73bf 100644
--- a/claude-rules/interaction.md
+++ b/claude-rules/interaction.md
@@ -64,7 +64,7 @@ Craig runs Claude Code inside Emacs EAT (through tmux). EAT renders SendUserFile
Two display lanes, by what the visual is for:
-- **Durable or interactive visuals** — HTML prototypes, full renders, anything Craig will study or click: open in the browser (`google-chrome-stable "file://<abs-path>" &>/dev/null &`) or imv, on a separate workspace per `desktop-capture.md`.
+- **Durable or interactive visuals** — HTML prototypes, full renders, anything Craig will study or click: open with `gui-open <abs-path>` (dotfiles-shipped; detaches through `systemd-run --user` so the agent shell can't reap it, resolves the Hyprland instance after a compositor restart, and confirms the window is actually visible before returning). It auto-detects image vs HTML; `--image` / `--browser` force. Place it off Craig's active workspace and name it, per `desktop-capture.md`.
- **Quick inline glances** — a chart, a did-it-render check: sixel in the terminal. Encode with ImageMagick (`magick <img> sixel:<out>`; img2sixel silently emits zero bytes on some builds) and display in a separate tmux window (`tmux new-window -d -n <name>`, then `tmux send-keys -t <name> "clear; cat <out>" Enter`, tell Craig the window name) rather than the Claude Code pane, whose TUI repaints over anything drawn into it. With native tmux sixel active, the image lives in tmux's grid and survives window switches, scrolling, and resizing.
**Capability gate.** Native sixel needs two config pieces: EAT answering the XTWINOPS cell-size query (patched eat.el, owned by .emacs.d) and `terminal-features 'xterm*:sixel'` in tmux.conf (owned by dotfiles). Check before relying on it: `tmux display -p '#{client_cell_width}'` — nonzero means go; 0 means the chain is missing a piece, so fall back to the browser lane. (Diagnosed 2026-07-13: tmux won't transmit sixel until it knows the client's cell pixel size, and stock EAT 0.9.4 silently ignores the CSI 14 t query tmux uses to ask.)