Fix window renaming on reattach after forestui is killed#22
Merged
Conversation
When forestui was killed and then re-launched to reattach to an existing tmux session, it would incorrectly rename the first window (e.g., "ssh") to "forestui" in addition to creating the correct new forestui window. Root cause: TmuxService.current_window used session.active_window (the window the user is viewing) instead of the window the forestui process is actually running in. On reattach, the active window is window 1, not the newly created forestui window. Fix: Use TMUX_PANE env var to find the process's own window. Also fix the hardcoded "forestui" name in the recreated window to respect dev mode. Additionally improves the test-forestui skill with lessons learned: - Never call tmux directly, always go through tu - Use a parent bash shell for detach/reattach test flows - Check .tmux.conf for rename-window prompt behavior - Proactively test visual/behavioral changes Strengthens CLAUDE.md to require make check before pushing/opening PRs.
Adds `ruff format --check` as a `format-check` target to the Makefile, included in `make check`. CI now catches lint, type errors, and unformatted code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TmuxService.current_windowto useTMUX_PANEinstead ofsession.active_window, so the rename targets the process's own window."forestui"name instead of respecting dev mode (forestui-dev-HHMM).test-forestuiskill with lessons from this session: never call tmux directly (usetu), use a parent bash shell for detach/reattach flows, check.tmux.conffor rename prompt behavior.make checkbefore push/PR.Test plan
make checkpasses (lint + typecheck)