Skip to content

Fix window renaming on reattach after forestui is killed#22

Merged
flipbit03 merged 6 commits intomainfrom
feat/fix-window-naming-on-reattach
Mar 29, 2026
Merged

Fix window renaming on reattach after forestui is killed#22
flipbit03 merged 6 commits intomainfrom
feat/fix-window-naming-on-reattach

Conversation

@flipbit03
Copy link
Copy Markdown
Owner

Summary

  • Bug fix: When forestui was killed and re-launched to reattach, it renamed the first window (e.g., "ssh") to "forestui" in addition to creating the new forestui window. Fixed TmuxService.current_window to use TMUX_PANE instead of session.active_window, so the rename targets the process's own window.
  • Bug fix: The recreated window used a hardcoded "forestui" name instead of respecting dev mode (forestui-dev-HHMM).
  • Skill improvement: Hardened the test-forestui skill with lessons from this session: never call tmux directly (use tu), use a parent bash shell for detach/reattach flows, check .tmux.conf for rename prompt behavior.
  • CLAUDE.md: Added proactive visual testing guidance and enforced make check before push/PR.

Test plan

  • Reproduced the bug: kill forestui window, detach, reattach → window 1 wrongly renamed
  • Verified the fix: same flow → window 1 keeps its name, new forestui window created with correct name
  • make check passes (lint + typecheck)

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.
@flipbit03 flipbit03 merged commit 3e56bc2 into main Mar 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant