Dragging a tab as far right as it goes left it one place short of the
end (4 tabs: the first one landed third, the move posted to: 2). The
clamp stops the dragged tab with its centre exactly on the last tab's
centre, and the comparison was strict. A tab after the dragged one now
counts as passed once the centres meet; one before it still needs the
centre to cross, so a press that does not move stays in place.
Found while integrating #852 with #816 (shipped in 1.52.0). The strip
walk in test/desktop-tabs-pages.browser.test.ts drags past the end; that
check fails without the fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The strip removed the proxy headers from req.headers only, while
req.raw.rawHeaders and req.raw.headersDistinct still held the secret.
takeTrustedProxyHeaders() now takes the raw message and removes them
from both. A plain splice is not enough on a real IncomingMessage: its
headers and headersDistinct getters are lazy and walk rawHeaders up to
the count stored at parse time, so one that first runs after the splice
throws. Both are read (cached) first. Two tests, each caught by its
mutation: the stripping test checks the raw list, and a real http
request checks all three views and that the getters still answer.
- CLAUDE.md's Rate limit row names the trusted-proxy secret's own bucket.
- The wiki lists the loopback addresses the check accepts, as the
contributor offered.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Dock button's hidden attribute was set only when a preview opened, so
with a preview open, switching Codex files off left a Dock button that did
nothing and switching it on showed none until the next preview.
applyHeaderVisibilitySettings() now sets it beside the Response files
button, and a test flips the setting with a preview open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI tools write specifications, reports and plans as HTML as often as
Markdown, and handing one to a session as context is the same job as
attaching a .md. Paste, drop and every Attach picker refused them with
"Unsupported file type".
.html/.htm join the text family (UTF-8, no NUL byte) on the server and in
every browser copy the parity test pins. An upload is stored to be read,
never rendered on Codeman's origin: file-raw serves it as octet-stream with
nosniff and html-view refuses a page under .codeman-uploads, both now pinned
by tests. Scripts (.sh, .py, .js) are still refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chromium never breaks a line after `/`, so under the cells' `break-word` a
URL, an identifier or a hash in backticks set its column's width, and the
whole table scrolled sideways on a phone. Inline code and links in a cell
now break anywhere, and a cell holding one gets the 6em floor that cells
with a linked path had. In a 360 px column in Chromium and Firefox, URL,
identifier and hash tables fit as they did on master.
Two costs remain. A code-only column such as `-v` grows from 52 px to
80 px. CSS cannot tell an autolink from a link with a prose label, so a
long word in a label can break mid-word in a narrow column.
The test's selector lookup now splits a selector list only on commas
outside parentheses, so it can find the `:is()` and `:has()` rules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first commit left one case of the same squeeze. Codeman turns the
paths in an answer into links, and a linked path keeps
`word-break: break-all` so that it can wrap anywhere. That lets the
browser count every letter as a break point when it sizes the column,
so in a table whose headers fill the width, a column of paths shrank
to three or four letters per line. A cell that holds a linked path now
has a minimum width of 6em. Other cells keep their natural width, so a
narrow column such as row numbers stays narrow.
On a 390 px view in Firefox and Chromium, a path column went from 48 px
to 83 px, and a `#` column kept its 32 px.
The comment on the cell rule also said wrongly that a cell breaks a word
wider than its column. In automatic table layout a column is never
narrower than its longest word, so that never happens, and the comment
now says that.
The test reads every rule that names a selector, in styles.css and
mobile.css, with comments removed first, so a later override fails it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rendered markdown sets `overflow-wrap: anywhere` so that a long path in
prose wraps, and table cells inherited it. With `anywhere`, the browser
counts every letter as a break point when it computes a cell's minimum
width. The header cells never wrap, so in a table whose headers fill the
width, the column under an empty header got only its minimum width, and
its labels stood one letter per line.
Table cells now use `overflow-wrap: break-word`. A cell still breaks a
word that is wider than its column, but its minimum width is its longest
word. In Chromium, the label column of a five-column table went from
36 px to 74 px and wraps between words. A table with an unbreakable
cell wider than the view scrolls sideways inside its wrapper, which the
wrapper already allows.
The Response Viewer and the File Viewer's markdown view share these
rules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Response files header button, taking a click on a Codex sidebar file
tab (and the link suppression on those rows) and the Dock control on file
previews now sit behind one per-device setting, codexFilePreviewsEnabled
(App Settings > Header buttons > Codex files), default off. With it off
none of the three exists, and Response files stays off phones even with
it on.
Also from the second review: the docked preview is z-index auto so it
sits under modals and the response viewer, a double-click no longer
opens the preview, the parsed conversation is cached per idle session
until its next turn, the Response files rows are buttons, and the two
tests that failed at the previous head pass. Documented in
Settings-Reference, Working-With-Files and src/web/CLAUDE.md.
A non-root account with a working passwordless sudo and no controlling
terminal (su - user -c, cron, a CI runner, cloud-init) ended on "Failed to
obtain sudo privileges". The /dev/tty node exists there and cannot be opened;
install.sh tested [[ -e /dev/tty ]] and then ran sudo -v < /dev/tty, whose
redirect fails before sudo starts. Measured 2026-11-27 in a fresh ubuntu:24.04
container: node present, open refused, sudo -n true fine, install dead at
"Installing Git via apt".
- tty_openable() opens the node, the probe has_tty() already used, and every
redirect from /dev/tty now sits behind it instead of a file test:
ensure_sudo, sudo_session_try, the message choice in sudo_session_start,
and the three sites with the same shape (Homebrew, the Tailscale installer,
tailscale up). With no terminal they fall back to the plain command.
- ensure_sudo returns as soon as sudo -n true works. sudo -v is no substitute
for that test: it asks for a password as soon as one sudoers entry of the
account asks for one, so an account in the sudo group with a NOPASSWD entry
of its own (the cloud-image layout) runs sudo <command> freely and is
refused by sudo -v (measured on sudo 1.9.15).
test/install-sh-invariants.test.ts fails for a file test on /dev/tty and for
a redirect from it that is not directly under the probe, and drives the sudo
helpers in a real bash with no controlling terminal against a stub sudo.
Checked in a throwaway ubuntu:24.04 container, through su - user -c with
CODEMAN_NONINTERACTIVE=1: the installer before this change stops at the sudo
step, this one installs git, tmux, Node.js and the build tools, clones and
was building when the check was stopped. The helpers were also run under
bash 3.2.57. The Homebrew branch could not be run here (no macOS).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Installed and started as root (a VPS, an LXC container), every local Claude
session died at once: the default permission mode launches Claude Code with
--dangerously-skip-permissions, and Claude Code refuses that flag under uid 0
("cannot be used with root/sudo privileges for security reasons", pane dead
with status 1). Shell sessions were fine. Measured 2026-11-27 with the public
installer in a fresh ubuntu:24.04 container.
Docker cases already answer the same refusal for a root container with
overlays.docker.rootCommand. This is the host-level form, as registry data:
- An enum launch param may declare rootValue, a map from a value to the value
it takes when the server process runs as uid 0 and the launch is local.
Claude declares claudeMode: dangerously-skip-permissions -> normal. The
schema holds keys and replacements to the param's values.
- applyRootValues() (config/cli-registry/root-launch.ts, pure) rewrites the
param values before the argv engine sees them and hands back the object it
was given when nothing changes, so a launch that is not root is
byte-identical (the spawn goldens are untouched).
- serverRunsAsRoot() (utils/server-uid.ts) reads the uid at call time. Under
vitest it answers false unless a test stubs it.
- The uid is asked in two places only. serverRootSpawnOptions() feeds the two
tmux launches (createSession, respawnPane), which every local tmux launch
goes through: new session, resume, dead-pane respawn, restartCli(), cron,
quick-start, reboot restore. buildPermissionArgs() covers the two launches
with no tmux, the direct-PTY fallback and the one-shot run.
- Remote and Docker pane commands never read it, and auto, allowedTools and
normal are passed through unchanged. IS_SANDBOX is not set.
- Each swap is logged once per launch, naming the cause and the way out.
Checked end to end in a throwaway ubuntu:24.04 container running this tree's
server as root with Claude Code 2.1.332: the pane command carries no bypass
flag, the pane stays alive on Claude's first-run screen, and the log line is
there. The same run as an ordinary user keeps the flag.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A local or Docker Claude session can show its conversation as rendered text,
the way the Response Viewer draws it, in place of the terminal. The terminal
stays attached and sized underneath, so switching views never resizes the pane,
and the user still types in the terminal. Discussion #858 has the background.
- A Chat / Terminal switch and Alt+Shift+C change the view, and each session
remembers its choice on this device until the session is gone. Two per-device
settings pick the default view and hide the switch. Phones, remote and
adopted sessions keep the terminal.
- The server broadcasts `transcript:update`, at most one per 750 ms per session,
and the view re-reads the conversation on it, so an answer fills in mid-turn.
- The server keeps each transcript's parse and the byte offset it reached, so a
read parses only the bytes appended since the last one, in chunks with an await
between them. Overlapping reads of one file share one pass. The Response
Viewer and the Discord bridge read through it too.
- A full conversation read starts a transcript watcher for a session that has
none, such as one picked up after a server restart.
- A Docker session's hook reports the container's transcript path, and the
server watches the host's copy of that file.
- After `/clear`, Claude Code runs the statusline command with the new
conversation's id and transcript path. The statusline exporter posts them, and
the server follows the new conversation the way it follows a hook's report.
- Keep-warm turns are hidden, long prompts fold, a "Working" line shows the turn's
running time, and a pending dialog shows a notice that opens the terminal.
The design note, docs/chat-view-plan.md, covers this and the four steps that
follow it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both land in this release. #839 makes _cleanupPreviousSession() settle the
main pane's native input first, and #815's test drives that method on a
stub app that did not have it.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The one-row nudge before a forced resize at an unchanged size runs only
for a tmux-backed session. On a direct PTY the process is the agent
itself, which got two height changes where master sent none. The
unrelated table reformatting in docs/tui.md is dropped.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The live-pane close case moves into test/kill-pid-guard.test.ts, whose
harness answers ps from a fixed table. In tmux-manager.test.ts the mock
keeps the real execFile, so the walk read this machine's process table.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Under a dead web-tab capability, GET /webview/<cap> without the trailing
slash and a WebSocket upgrade have no route status to copy (the route
alone redirects, or accepts and closes with 4003). With trusted-proxy
sign-in on, the hook answers both with 403, no challenge and no count.
The refusal test sends each of them more often than the per-IP failure
limit, before its final Basic sign-in, so a counted one turns that
sign-in into a 429.
Review follow-up on the follow-typing attach.
- Redraw (and every forced resize at an unchanged size) handed the window
back to the terminal: an unchanged pty sends tmux no SIGWINCH, so the
terminal stayed the latest client and the after-resize-window hook undid
the resize-window. Session.resize() now nudges the pty one row first
(FORCED_RESIZE_NUDGE_MS), then applies the size, so tmux counts the tab
as the client used last; the second move bumps the guarded geometry
revision too. Under manual with no attach the agent sees no change.
- With the nudge, client-active[91] alone covers every case, so the
after-resize-window hook is gone. It kept latest through every browser
resize and cost the agent three height changes per resize; now the first
resize after the terminal was used costs two and later ones one. The
cost is stated next to the hook.
- The leak sweep matched owners by tty, and Linux hands the next terminal
the pty that just closed, so the common leak was never swept. The arm
now records the TUI's pid (@codeman-tui-follow-pid), and the sweep keeps
only sessions this process armed (a Set filled before the first write)
or whose pid is another live process. One list-sessions call reads every
owner. It also runs before each attach dresses its sessions, so
`codeman tui <n>` gets it and a leaked hook cannot undo presizeWindow().
- `set-hook -u` on our index left an empty session-level array, which
hides the user's global hook on that event. Disarm unsets the whole
event when ours is its only entry, and arm refuses while the user has a
global client-active hook.
- Arm and disarm are one tmux call to read and one to write (`;` lists).
- Docs: the "forced resize when a browser opens a session" wording was
wrong (selectSession sends no force; only Redraw, a closing pop-out and
the split pane do), fixed in tui-client.ts, docs/tui.md and the
invariants, whose paragraph now stands on its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up (owner's merge-time items, applied here).
- killSession() used `pane.pid ?? session.pid`, which kept tmux's 0 for
an empty active pane (`split-window ''`: `1|0|` up to tmux 3.6, `0|0|`
on 3.7) beside a running agent, so the close signalled nothing where
master signals the agent's tree. `||` restores that; isSignalablePid()
still refuses 0 or 1.
- kill-pid-guard.test.ts answered the old pid-only read, which the
three-field parser read as no pid, so no case gave killSession() tmux's
own 0. Its mock now answers the kill read, with cases for `1|0|`,
`0|0|` and `0||` against a recorded agent pid and a recorded 0.
- Tests pin the whole kill read format, and the reconcile rule that a
pane without a pid never overwrites a live pane's pid. Dropping
`#{pane_dead_time}`, using `??` or `pane.pid` alone, or a plain
`active.set(...)` each fail now.
- parsePaneKillRead() cases for `1|0|`, `0|0|` and `1|-1|`.
- Comments and docs: the blank pid with a late dead flag is tmux 3.8;
on 3.4 only the seconds to collect the status were measured. A pid
below 2 is no pid. The recorded pid is unreaped in the closing window
only when it is the pane's start pid (`respawn-pane` breaks that).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the killSession() conflict with babb55e4 (never signal pid 0
or 1). The dead-pane read decides first; a pid that is not signalable
(isSignalablePid) then also means nothing is signalled and only
`tmux kill-session` runs. killPaneProcessTree() sends every signal
through signalProcess().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A restore no longer pages through a whole large folder for an expanded
folder that is gone: directories are listed before files across pages, so
a loaded file ends the search, and the expansion is forgotten. An expanded
folder that waits for its turn in the restore says it is loading, and a
search-result folder opened while the tree was loading runs the restore
afterwards. The error line keeps its parts in separate elements so the
zh-CN entries apply, one local match reads in the singular, and the search
box labels the phone keyboard's Enter key.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The manual multi-user start line is printed only where no service runs:
next to a working service it would start a second server on the same data
dir and tmux socket. The Environment= reader removes quotes wherever they
sit in a word, as systemd does, so a hand-written CODEMAN_MULTIUSER="1" or
CODEMAN_PASSWORD="my pass" survives a re-run.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
tmux answers 0 for the pid of a pane without a process (`split-window ''`).
The pane list read at server start recorded that 0 on the session, and the
next close of the tab walked the children of pid 0, which is the whole
machine: every process of the account was signalled, all sessions, tmux
itself and the systemd user manager included.
killSession() now decides once whether there is a process to signal
(isSignalablePid(), an integer above 1) and otherwise leaves the close to
`tmux kill-session`. The descendant walk of the kill path returns nothing
for such a root, and signalProcess(), the only place in tmux-manager.ts
that sends a signal, refuses it for the process group form as well.
proc-walk-bounds used pid 1 as the root of its fixture tree, which the kill
path now refuses on purpose, so the fixture is rooted at a real pid.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The live-pane close test mocked process.kill to always succeed, so the
pane never exited and the kill path's wait polled isProcessRunning().
On Linux that reads /proc/<pid>/stat, which this file mocks to return
undefined, and the test threw "Cannot read properties of undefined
(reading 'lastIndexOf')". macOS skips that read, so it passed locally.
The mock now models a pane that exits on its first real signal, after
which kill(pid, 0) throws ESRCH. Reproduced the CI error locally by
forcing the Linux branch; it passes with this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up on the tmux 3.8 dead-pane fix.
- parsePaneRows() skipped a row with a blank pid and pane_dead 0. tmux
blanks the pid when the pty closes, and pane_dead turns 1 only once
the exit status is collected (seconds for some exits on tmux 3.4), so
a restart in that window dropped the session. Only a row with neither
a pid nor a dead flag is skipped now.
- Before tmux 3.7 pane_dead means only that the pty is closed. The kill
read now also reads #{pane_dead_time}, and counts a pane as dead only
with a blank pid or a set exit time, so a program that closed its tty
and ignores SIGHUP is still killed on tmux 3.3a to 3.6.
- Tests pin the last two pane format fields and add a live-pane
counterpart to the dead-pane kill test.
- Changeset notes that finished sessions piled up on 3.8 are relaunched
once at the first start after the update.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server strips the literal mount prefix before the auth hook runs, so
under a base path named /webview, /html-view or starting with one of
them, /webview/webview/x arrives as /webview/x. Removing the base path
again in capabilityPrefixOf() then took the capability prefix itself,
and such paths reached the Basic check and its failure count.
The normalised path is now judged as it is first, and only when that is
no capability path, once more with the base path removed once. Either
match counts, so this can only add refusals, never an exemption.
After App Settings or Session Options was opened with a mouse click and
closed, nothing typed reached the terminal until it was clicked again.
FocusTrap saved document.activeElement when the dialog opened, and by then
the press had already moved focus: onto the pressed control in Chromium and
Firefox, onto <body> in WebKit on macOS, where a button takes no focus from
the mouse.
FocusTrap.focusToReturn() is what a dialog saves now. A pointerdown listener
records the typing field that had focus when a mouse press began (pointerdown
comes before mousedown, whose default action moves focus), and that field is
the answer when focus sits on the pressed control or on <body> as the dialog
opens. Any key forgets the press, so a control reached with the keyboard gets
focus back as before. Only a typing field is remembered, for one press (a
press on a menu item inherits it from the press that opened the menu) and
only for a mouse, so touch is unchanged. Asking spends the press, so nothing
pressed inside the opening dialog can hand the keyboard to a field behind it.
The command palette and the Session Manager save the same answer.
Measured in Chromium against a running server: App Settings and Session
Options opened by mouse ended on the clicked gear before and in the terminal
after, also with the press clearing focus as WebKit on macOS does, with the
tile grid and the split open (the keyboard returns to the pane it was in),
and through a tile's menu. Not run in WebKit on macOS itself.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Under CODEMAN_BASE_URL the server strips the mount prefix only in its
literal spelling, so /CODEMAN/webview/x, /%63odeman/webview/x,
//codeman/webview/x or /x/../codeman/webview/x reached the credential
checks with the prefix still in front. A proxy's path matcher lets
those through without its sign-in, so they got a Basic challenge and
filled the per-IP failure bucket. capabilityPrefixOf() now takes the
base path and, after its normalisation, removes the lower-cased base
path once when the path starts with it. The exemptions are unchanged.
The secret file's real path is now resolved once, when the secret is
read, instead of on every sensitive-path check.
Tests for behaviour that had none: the last-login throttle for proxy
sign-ins, the 503 for an unreadable user store with a valid cookie or
Basic credentials, removal of X-Codeman-User when another username
header is configured, the normal challenge on capability paths with
the feature off, the secret file reached through a symlink, and the
reserved username header names.
Multi-user mode only accepted Codeman passwords over HTTP Basic, so a team with an
identity provider (Entra ID, Google, Keycloak, ...) had to sign in twice, with no link
between the two identities.
With a shared secret configured (CODEMAN_TRUSTED_PROXY_SECRET_FILE, or
CODEMAN_TRUSTED_PROXY_SECRET; at least 32 printable ASCII characters), an authenticating
reverse proxy on the same host (oauth2-proxy behind Caddy or nginx, mod_auth_openidc,
Authelia) forwards X-Codeman-Proxy-Secret and X-Codeman-User, and the request signs in
as that existing, enabled account. CODEMAN_TRUSTED_PROXY_USER_HEADER renames the
username header. The feature is experimental (docs/versioning-policy.md): its settings,
headers and the viaTrustedProxy field may change until promoted.
- Accepted only from a loopback socket (isLoopbackIp, now shared with the hook-secret
bypass) with a timing-safe secret match.
- The secret is read once at the start of WebServer.start(), before sessions are spawned
or restored, and both variables are then removed from process.env, since every
session inherits Codeman's environment. The secret file's resolved path stays in the
module for the sensitive-path blocklist.
- A configured setup that cannot be used stops the start, like the first boot without
users, with a message that says why and never contains the secret: both variables
set; a secret file that is unreadable, empty, or readable by group or others (not
checked on Windows); a short or non-ASCII secret; a secret with multi-user mode off;
a rejected username header name. getTrustedProxyConfig() returns null for the same
cases as a second layer.
- Both headers are read and deleted from every request by the first auth hook, in every
auth mode, so no exemption or route (e.g. the web-tab relay) can forward the secret.
The relay's drop list names them too, including a configured username header.
- Fails closed once the secret header is present, even empty: a wrong secret or a
non-loopback source is 401; a missing username, or one with no enabled account, is a
plain 403 with no challenge. None of these falls through to cookie or Basic. A
username header without the secret is ignored.
- The username is matched exactly: normalizeUsername(), then the user store's username
rule, no other transformation. A header sent twice arrives joined ("alice, bob") and
is refused.
- The secret is compared before the failure bucket, so a correct secret always passes;
only failures are throttled, in their own per-IP bucket.
- Checked before the session cookie; a cookie on the same request is neither used nor
refreshed, and no cookie is minted: the proxy authorizes every new request and
WebSocket upgrade.
- mustChangePassword does not gate a proxy sign-in, and GET /api/me reports
mustChangePassword: false and viaTrustedProxy: true. Proxy sign-ins update the
last-login time at most every 15 minutes.
- The username header is removed from every request, so its name is validated by shape
(an X-... extension header or Remote-User; standard and reserved headers refused).
- With the feature configured, a /webview/ or /html-view/ request the capability
exemptions don't let through is refused with the route's own 403/404 before the
credential checks, by prefix on a path normalised the way a proxy's matcher sees it
(case-insensitive, percent-decoded, dot segments resolved), whatever the token looks
like: the proxy has to let these paths through without its sign-in, so they must not
reach the Basic check, prompt or failure bucket. Without a proxy they keep the normal
401.
- The configured secret file is on the isSensitivePath blocklist.
- The startup log says "Trusted-proxy sign-in enabled (experimental)".
- Single-user mode, the Host/Origin guard and the hook-secret bypass are otherwise
unchanged.
Docs: security-architecture §10a, architecture-invariants, versioning-policy (new
experimental subsection), Settings-Reference, web-tabs and its wiki page, multi-user-plan,
the CLAUDE.md summary line, and a Caddy + oauth2-proxy walkthrough in the Multi-User Mode
wiki page (web tabs and HTML view bypass the sign-in and never get the secret; the proxy
removes its own session cookie; hook endpoints and their /api/v1 aliases are blocked;
optional username from an IdP claim; what the secret does not protect against).
Changeset included.
armFollowTyping() set the owner option, then a hook. On tmux before 3.3
there is no client-active hook, so the first set-hook failed and the arm
answered false with the owner still set; restore() disarms only what
armed, so it stayed on the session. A failed arm now drops the owner and
any of our hooks it already set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A browser that opens a session sends a forced resize at its current size.
Its pty does not change, so tmux keeps the TUI's client as the latest one
and `client-active` never fires again, while Codeman's `resize-window`
still pins the window to `manual` at the browser's size. Typing in the
terminal then did nothing, which is the bug this branch fixes.
An `after-resize-window[91]` hook now puts `latest` back after Codeman's
resize, so tmux keeps deciding by the client used last; `client-active[91]`
stays for Codeman's own attach (`setManualWindowSize()`), which sets
`manual` without a resize.
The owner's tty moves into the session option `@codeman-tui-follow`, and
both hook commands are constants that read it, so no tty is interpolated
into a hook and hooks whose owner is gone do nothing. restore() and the
startup sweep drop the owner first, then our hooks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A terminal that dies while attached (closed window, dropped SSH) never
reaches restore(), so its client-active[91] hooks stayed on the sessions.
TUI startup now removes ours whose tty has no live tmux client, next to
the leaked-banner sweep. The TUI's own tty is never swept: the sweep is
fire-and-forget, and an early Enter can arm that hook before the attach
client exists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>