Repository navigation
fix(sessions): restore a session's colour, pin and image watcher after a restart - #591
Open
opticon454 wants to merge 1 commit into
Open
opticon454 wants to merge 1 commit into
opticon454 wants to merge 1 commit into
Conversation
…r a restart restoreMuxSessions() re-applied name, auto-clear, auto-compact, auto-resume, nice and the flicker filter from state.json but not color, pinned/pinnedAt or imageWatcherEnabled, which the reboot-restore path (reapplyPersistedSessionState) already restores. After a restart or crash a surviving pane came back uncoloured, unpinned and with its image watcher off, and the next persist wrote that over the saved values. Found by killing -9 a server with a coloured, pinned shell session and restarting it.
opticon454
force-pushed
the
fix/restore-session-settings
branch
from
October 10, 2026 06:15
387ff11 to
79fd2dc
Compare
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
After a Codeman restart or crash, a session whose tmux pane survived came back with its name, auto-clear, auto-compact, auto-resume and flicker filter, but without its tab colour, pin and image watcher. They reset to defaults and the next persist wrote the defaults over the saved values.
restoreMuxSessions()re-applied the other settings fromstate.jsonbut never readcolor,pinned/pinnedAtorimageWatcherEnabled. The reboot-restore path (reapplyPersistedSessionState()) already restores all three; this brings the surviving-pane path in line. The image-watcher flag is set beforesetupSessionListeners(), which reads it.Found by running a server on a throwaway HOME, creating a shell session with a custom name, red colour, pin and every option on,
kill -9on the server, and restarting it: before this change colour, pin and image watcher were gone; after it, everything came back.Tests
test/session-settings-recovery.test.tspins thatrestoreMuxSessions()restores every persisted user setting (and everything the reboot-restore path restores), that the image-watcher flag is set before the listeners read it, and that the setters round-trip throughtoState().restoreMuxSessions()is not reachable under vitest, so the wiring is a source check, as intest/session-model-recovery.test.ts.