A Higher-Categorical Semantics of Terminal Multiplexers
Continuous, single-column reading. Equations, tables, proofs, references and appendices stay in document order.
Contents · 29 sections
RESEARCH MANUSCRIPT
A Higher-Categorical Semantics
of Terminal Multiplexers
From tmux window links to concurrent executions and local observations
Anonymous 23 November 2026
Abstract. Two terminal views can agree because they reach the same running computation or because separate computations currently display the same cells. We develop a semantics that separates these cases, beginning with tmux’s indexed window links, pane ownership, and scoped focus. A quotient of access paths explains when traversing aliases duplicates an effect. Independent commands generate invertible comparisons between execution paths. For a fixed finite batch with declared resource supports, we prove that all linear extensions of the dependency order reach the same state and have a unique comparison modulo interchange and the three-event cube relation. For simultaneous partial observations, a lossless-join criterion characterizes which matching views can arise from one legal snapshot. At a controlled marker interface we prove that recovering a sharing partition on n handles requires exactly n−1 writes in the worst case. A live tmux experiment and comparisons with GNU Screen, Zellij and dtach distinguish persistence, display reconstruction, and process identity.
Suppose a developer links the build window of a tmux session into a second session for an observer. The observer can watch a compiler already running. If the original session subsequently unlinks its copy of the window, the build can continue in the other session. What, exactly, was copied, and what survived? A model in which sessions are trees of privately owned processes predicts the wrong result. The two terminal images alone cannot settle the question either, since two independent panes can display the same output until a user types into one of them.
This paper takes a terminal multiplexer to be a system that mediates access from one or more terminal-facing clients to logical endpoints over time. Access can be multiplexed across endpoints, clients, or both. A full model distinguishes the address used to reach an endpoint, the one computation it reaches, and the result displayed by a given client. The distinction applies to local and remote clients alike. It also describes the single-endpoint limit in which a relay supplies attachment but has no display model of its own.
Three questions drive the development. If an interface acquires another name for a shared pane, which operations should produce an additional effect? What information must a scheduler retain before exchanging two commands is sound? How much of the shared state can observers reconstruct from terminal views and controlled input? The answers use different categorical structures. A quotient of addresses expresses aliasing. A (2,1)-category compares executions that differ by independent swaps. A sheaf glues simultaneous partial readings, and an image relation tests whether a single legal server state could have produced them. Finally, a coalgebraic behavior map records the observations obtainable by finite sequences of tests.
We prove two sharp statements about sharing. Extending a traversal of visible occurrences to repeated aliases preserves a per-endpoint action for arbitrary alias multiplicity exactly when the action is idempotent on the tested states. At a complementary black-box interface, n−1 single-handle writes are both sufficient and sometimes necessary to recover the unknown sharing partition on n handles. For the finite-batch coherence result, ordering conflicting operations gives a partial order whose legal schedules have a unique comparison once disjoint squares and the three-event cube equation are imposed. The proof states where this reduction breaks for real clients.
Evidence and scope.
The operational reference is the tmux 3.5a manual as packaged by Debian. The finite experiments use the same upstream version [1]. Claims about GNU Screen, Zellij, and dtach are derived from their own manuals. Proofs concern explicitly defined models. Captures of a running tmux server, Linux pseudoterminal experiments, and bounded enumeration exercise selected hypotheses. No whole-implementation equivalence is assumed. The underlying mathematics draws on trace theory, geometric concurrency, sheaf descent, and coalgebraic behavior [12, 13, 14, 17]. The contribution is the identification of mux resources and observation boundaries for which these tools give checkable results.
A related engineering precedent is Mosh, which synchronizes terminal-emulator state between a server and a roaming client [10]. In that design, two transmissions may bring the client to the same grid after different intermediate states. Our model adds multiple client routes, sharing of application state, and tests of the order in which operations affect shared resources.
A typed operational model of tmux
Names, window links, and live endpoints
At a server instant take finite sets C,S,L,W,P of attached or available clients, sessions, session-window links, windows, and panes respectively. A skeletal model for ordinary tiled windows has maps a:C⇀S,SsLwW,o:P⟶W. An attached client has a defined a(c). A link ℓ has an integer index i(ℓ) unique within s(ℓ). The pair (s,i) identifies a slot at an instant. The target w(ℓ) is the window reached there. Pane ownership is o. Each ordinary live pane has a PTY endpoint and a running workload, which may contain multiple processes. Retained dead panes or special empty panes require a partial live-endpoint assignment. Pane IDs and PTY incarnations should be tracked separately across respawn. tmux distinguishes server object IDs from relative target expressions and mutable positions [1].
A nonempty session selects a link j(s0) above s0, and an ordinary nonempty window selects a pane f(w0) above w0. Thus sj=1S and of=1W on these domains. In the ordinary shared-focus case, the pane reached from a client with no explicit target is represented by c⟼f(w(j(a(c)))). Use this formula for the selected pane in our fragment. Full command resolution also depends on the command, its source context, marked panes and target syntax. The active-pane client flag can supply a client-specific selection for the cursor and client commands while hooks and styles can still use window focus. Two clients of one session normally share its current window, while sessions in the same session group can choose different current windows from the group’s linked set. A model that scopes all three pointers to the client misroutes ordinary input.
Two links target one window. Traversing either link and then taking the fibre of pane ownership reaches the same pane. Removing one link leaves the other route and its endpoint available.
The set of possible pane occurrences along these routes is the pullback H=L×WP={(ℓ,p):w(ℓ)=o(p)}. Taking the fibre over a session selects its occurrences, while projecting q:H→P forgets the access path. Restricting to one client, viewport, or policy gives a subset of this domain. A view can crop or omit cells within an occurrence. Terminal images and routing plans therefore live over different maps even when they use the same pane IDs.
Events and observation boundaries
The following operations specify a fragment on quiescent boundaries. We suppress hooks, asynchronous exits, automatic renumbering and implicit fallback selection unless the operation under discussion needs them. Commands accept valid explicit targets. Empty-session and last-link behavior must be specified when extending the fragment to those cases.
Operation
Resource change in the fragment
link-window
Add a fresh link to an existing window at a free destination. The window, its panes and live workloads retain identity.
unlink-window
Remove a named link where another link keeps the window reachable. A selected link requires a new valid selection if the session remains.
split-window
For a successful ordinary shell split, refine the window layout, create a pane, allocate a PTY and start the command. Existing links refer to the changed window.
select-pane
Change the applicable focus pointer. A later input with a relative target can therefore have a different recipient.
detach-client
Remove an attachment. Retention settings, active clients, hooks and size policy determine additional effects.
Pane output
Consume bytes at one endpoint, update its terminal parser and grid, and make the resulting state available to eligible observations.
One command can trigger several events. For example, a split can resize an existing application and generate later output. In the full machine, determining a target, queueing bytes, the slave process reading them, parsing its reply and sampling a screen can be distinct steps. A tmux server multiplexes clients through command queues. The observation model determines which intermediate steps to expose. It is permissible to treat an entire command as atomic only for an observer that cannot distinguish the intervening effects.
The terminal path in both directions
Consider the forward path from a physical key to a running program. Client key decoding and a key table may consume a prefix, execute a command, change a mode, or forward data. For the forwarding branch, target resolution selects one or more eligible panes. Encoding depends on terminal modes. The PTY’s line discipline can buffer input, echo it, or turn a configured interrupt character into a signal for the foreground process group [3]. The word typed, the bytes written to a master, and the sequence the application reads are therefore three distinct observations.
In the reverse direction, parsing output requires more state than the visible grid. At fixed geometry let T contain a terminal’s grid, cursor, modes, applicable history, and incomplete parser state. For a chosen deterministic byte parser with no outside effects, writing a string gives a right action of the free monoid B∗ of bytes satisfying δ(t,ϵ)=t,δ(t,uv)=δ(δ(t,u),v). The equations follow by folding the single-byte update over the string. With generated replies, extend the state by an ordered reply channel or accumulate the replies under concatenation. The equations concern chunks of an identical ordered stream. They fail for a parser restarted at every chunk boundary. For example, the sequence consisting of ESC, [, 2, and J encodes an erase-display instruction in a supporting terminal. The state after ESC and [ must survive until the parameters arrive [5, 6]. Recording every chunk boundary or permitting a timeout between chunks defines a stronger observation.
A client then samples terminal state through a layout, viewport, rendering capabilities, and mode. A capture-pane text snapshot, a client’s rendered image with borders or overlays, and a control-mode notification carrying pane output are different data types [1, 2]. Joining them by string equality would identify unrelated events. Figure 2 marks where the experimenter can insert an observation.
Observable boundaries for one target. A keystroke can end at the router. Forwarded input can be held by the line discipline, while a later application reply can change the grid seen by several clients.
Routing through aliases
A control program can list panes by traversing the windows of each session. A loop that sends one character to every pane it encounters therefore visits some panes more than once. The same traversal is entirely reasonable for listing what each session can see. The difference has an algebraic explanation.
Restrict the occurrence map to a finite set of intended handles H0 and corestrict it to its image P0=q(H0). Denote the resulting surjection by q0:H0↠P0. In sets, P0 is the coequalizer of the two projections of the kernel pair H0×P0H0⇉H0q0P0. Indeed, a function on H0 takes the same value on each pair in the kernel precisely when one can define its value on p by choosing any handle for p. Surjectivity makes this factorization unique. If there is a pane-dependent state set Tp, a resource snapshot (tp)p∈P0 pulls back to the family (tq0(h))h. In particular, sharing a pane duplicates readings without duplicating that pane’s state. Client-specific annotations may differ because they have additional address coordinates.
In the other direction, a set D⊆H0 of selected handles determines the set of physical recipients q0[D]. Set image satisfies q0[D]⊆U⟺D⊆q0−1[U]. This adjunction on power sets gives a canonical once-per-recipient interpretation of a uniform broadcast. Repeating a handle has no effect on the recipient set. Emitting an action while traversing a list of handles implements a different semantics.
Theorem 1 (Alias invariance of traversal). Fix an endpoint state space T and an action with deterministic local effect F:T→T. An observer can distinguish different values of T. Endpoints are independent during the command and each visit applies F once. Over all finite nonempty fibres and initial states, a visit to every handle gives the same endpoint state as one application per distinct endpoint if and only if F2=F.
Proof. An endpoint with k selected aliases ends at Fk(t). Two aliases for one endpoint and arbitrary t force F2(t)=F(t). Conversely that identity implies Fk=F for k≥1 by induction. Endpoints with no selected handles are unchanged by both semantics. Independence lets us apply the calculation separately to each coordinate. ◻
If a fixed command sets a field to a constant, its effect on that field satisfies the theorem. If updating it twice emits two notifications and the observer counts them, the enlarged state need no longer be idempotent. For queued literal input u use the word-valued state T=B∗ with F(t)=tu. For u=ϵ, tuu differs from tu even at t=ϵ. A controller that logs its writes to the master can see the difference, as can a cooperating raw-mode slave reader after delivery. Conversely, a coarse observation can hide the second copy. Applying the theorem on a quotient requires a well-defined induced endomorphism there. This result concerns an occurrence-enumerating controller. tmux’s own synchronize-panes operates within the window on other eligible panes with synchronization enabled, subject to pane modes [1]. It does not traverse every link in every session.
A worked command trace.
Assume two independently named sessions A,B, with ordinary live panes, and let w initially belong to A. Keep an unrelated guard window in each session when needed so that both remain nonempty. Link A’s window at a free slot of B. Resolve the shared pane via the two links and record equal pane IDs. Direct one marker input to the first handle and read both. A cooperating process in p emits the marker once, and after the update both reads can see it. Now perform the same command by visiting both occurrences and writing on each visit. This time the input queue gets two copies. Unlink A’s link while B retains its link. Now only B still addresses p via the illustrated pair. The operations distinguish site of observation, multiplicity of input, and lifetime of the process.
The alias quotient also determines how to compute read and write supports. Two loops that write to syntactically distinct session targets can still write to one input queue. A comparison of target strings misses the conflict. Appending a then b can produce ab, while reversing them can produce ba. Resolve the targets to backing resources and include the state consulted during resolution. The resulting criterion is developed in Section 5.
Detach, resize, and the boundary of persistence
In a restricted server model write a state as (k,v), with k the core and v the clients’ attachment and view state. Include PTY identities, application state relevant to the observer, and retained parser and grid data in k. Let U(k,v)=k forget the views. A client change d is transparent to this observation at x if U(d(x))=U(x). Changing geometry in the kernel, killing a last session, or delivering an application-visible focus event may violate this equality.
Proposition 2 (Erasing attachment bookkeeping). Fix a finite executed schedule. Suppose every client-only step preserves U. For each core event e with fixed data, suppose its enabledness depends only on U(x) and it has a deterministic projected update e satisfying U(e(x))=e(U(x)) whenever enabled. Projecting the schedule to its core events gives an executable path on core states with the same projected final state. Two schedules starting from the same core and having the same ordered core events then end in equal cores.
Proof. Induct along the schedule. A client-only step leaves the induction invariant unchanged. At a core step, core-dependent enabledness permits the projected transition and the stated equation identifies its successor with the next projection. The initial core and the projected word determine its final state. ◻
For a detached compiler this law allows continued computation while no clients are present. Application steps and PTY output still occur in the projected word. Reattachment can therefore display a later state of the same computation. The proposition does not assert that a detached and attached run will receive the same inputs, timers or scheduler decisions. These are assumptions to check when comparing the two words.
In tmux, exit-unattached, destroy-unattached, hooks, and window sizing policy are relevant to the premises [1]. Consider a window whose size tracks the smallest eligible attached client. Attach a second smaller client under that policy, with both clients displaying the window and contributing their sizes. Adjusting the PTY can deliver SIGWINCH to its foreground process group on Linux [4]. An application can print its new geometry in response. The client-only interpretation now fails at the resize, and the further output has an identifiable cause. A client viewport moving over unchanged backing cells is a different operation, which need not resize the PTY. Removing a client, restarting a server, respawning a pane, and rerunning a saved command are likewise different proposed implementations of persistence. Section 7 supplies an example in which a saved command omits a private bit of application memory.
Independent edits and the groupoid of schedules
Suppose that one output chunk arrives on each of two panes. An observer who polls both panes after the two updates may see the same result in either order. An observer who records each arrival on a common time line can distinguish the orders. A client that samples the display between the updates supplies a third event whose dependencies must be recorded. The choice of observation therefore enters the construction of an execution square. Partial commutation of words is classical in trace theory [12], and cubes for independent transitions have a geometric interpretation in concurrency theory [13]. We specify the resources that justify applying those constructions to a terminal server.
A test for a commuting square
Fix an interval of modeling and an abstract store X=∏r∈DXr. Its coordinates may include a pane’s parser state, its pending input, a session’s current-window pointer, or an ordered output channel. An event occurrence e has a name, a guard, read support Re⊆D, and write support We⊆D. The guard and all new values depend only on the old values on Re, with external data such as an arriving byte string fixed as part of e. A successful update fixes all other coordinates. Include a coordinate in Re when its new value uses its old one. Represent emitted effects by updating the corresponding channel histories in the store, at the granularity the observer retains. In particular, an ordered log shared by two operations is a shared resource. Every event has a definite target. Resolving a relative pane target requires reading the selection on which that resolution depends.
A sufficient condition for two occurrences e,f to commute is We∩(Rf∪Wf)Wf∩(Re∪We)=∅,=∅. Indeed, if ef can run, f’s guard already held before e ran. Running f first preserves e’s guard and all the values e will use. The two final stores coincide coordinate by coordinate. The converse follows by symmetry. Here and below, juxtaposition denotes execution in written order. Two writes of the same constant can commute even when the support test fails.
Consider the parser update for a known output chunk on pane p. If it reads and writes only p’s terminal state, a similar update for q=p passes the test. This statement is about the parser stage with independently indexed terminal state. Adding a shared arrival log, an effect on a shared clipboard, or an intervening observation may change the answer. A second instructive pair consists of selecting pane q and sending a key to the active pane. When p was active, the two orders deliver the key to different endpoints. An input event using an explicit target can avoid that particular read. Its other effects still need their own supports.
Paths, swaps, and their equations
Generate a strict (2,1)-category as follows. Its objects are stores and its 1-arrows are finite paths of enabled transitions, including the empty path. For each certified unordered pair at a given store, choose one orientation of its commuting square and adjoin an invertible 2-arrow between the paths ef and fe. Paths keep separate names for repeated occurrences. A 2-arrow can be applied inside a larger path by prefixing or suffixing the same transitions. Impose the interchange law for swaps in disjoint positions and the following equation whenever three independent events can be executed in all six orders with the stated squares. If si exchanges the events in positions i,i+1, the equation for the two composites from abc to cba is s1s2s1=s2s1s2.
↗abc↘bacacb⟶⟶bcacab↘cba↗
Three output chunks a,b,c on independent endpoints. Each vertex is a complete execution order. Each edge swaps one pair. The cube equation equates the upper and lower comparisons.
The indices here refer to the current word at each step. Figure 3 displays the two comparisons. Geometrically the six words are the six directed edge paths across a three-dimensional execution cube. Its six square faces give the six swaps in the displayed equation. We use this cube as an equation between pastings of 2-arrows. The 1-arrows ef and fe remain distinct ordered paths, even when joined by a swap. Inverting that 2-arrow gives a comparison of the same executions in the reverse direction.
Coherence for a finite batch
Take one executable word w from store x with finite set E of distinctly named occurrences. Order every pair failing (1) by its order in w, add any specified program-order constraints consistent with w, and take transitive closure. This defines a poset P on E. Within this batch, the admissible schedules are the linear extensions of P, and the permitted comparisons exchange adjacent incomparable occurrences. Additional program-order constraints can intentionally keep even commuting actions ordered. Write L(P) for the groupoid generated by these swaps, with cancellation, disjoint interchange, and the three-event equation above.
Theorem 3 (Finite-batch schedule coherence). Every linear extension of P executes from x to the same modeled store. Between any two extensions there is exactly one arrow in L(P). More generally, every order ideal J of P determines a store xJ independent of the schedule used to reach it.
Proof. Choose a reference extension u and rank the occurrences by their positions in u. In any extension unequal to u, an adjacent inverted pair exists. The two elements are incomparable, since otherwise their relative order would agree in both extensions. Swapping them preserves the extension and decreases the inversion count by one. Thus every extension reaches u. Taking u=w and running the swaps backwards from w proves executability and endpoint equality by the support test.
For uniqueness, orient swaps towards lower inversion count. Compare two possible first reductions. Identical reductions need no comparison. Reductions in disjoint positions yield a square by interchange. Overlapping reductions begin with three ranks in strictly decreasing order. The three occurrences are pairwise incomparable because each pair has opposite orders in the current extension and in u. Both first reductions therefore extend through valid decreasing swaps to the reversed triple. The two pastings agree by the three-event equation. An induction on inversion count now equates any two decreasing paths to u by continuing from the join to u and applying the induction hypothesis at each immediate successor. Denote the resulting normalization arrow by nv:v→u. For every decreasing generator t:v→v′, nv is t followed by nv′. Invertibility gives the corresponding identity for increasing generators. Consequently any zigzag from v to v′ equals nv followed by nv′−1.
Every extension of J is a prefix of an extension of P, since J is downward closed. All its orders are executable by the first assertion and are joined by swaps inside that prefix, proving independence of xJ. ◻
For an ideal J and an occurrence e minimal outside it, executing e at xJ yields xJ∪{e}. Thus the poset of ideals indexes intermediate stores and the scheduling groupoid controls comparisons of paths between them. For example, let a,c append successive chunks to the history of p, while b appends to q. The only constraint is a<c. Its three completed schedules are acb,abc,bac. A test that depends only on the completed pair of histories needs one representative. A test that reads q immediately after a introduces a read event whose order relative to b can affect the result.
The theorem permits hidden implementation steps only to the extent justified by the chosen atomic events. In particular, a size change can trigger process output. Treating the resize and the response as separate events exposes their causal order. A test of independence at a single initial state cannot generally justify a cube. In a store with two free slots, three allocation requests can each be paired successfully, yet no ordering of all three succeeds. Equation (1) records their common capacity coordinate. Dynamic aliasing, allocation, or policies that select a target when a command runs require similar attention before reordering commands. The theorem supplies a reduction for specified finite schedules and observations. It asserts neither scheduler fairness nor conformance of every tmux command to a particular choice of atomic steps.
A general multiplexer and maps between implementations
We now free the construction from the incidence diagram of tmux. A multiplexer specification consists of a state-indexed interface. Each state x has clients Cx, slot labels Vx, backing endpoints Ex, and an incidence relation Ix⊆(Cx×Vx)×Ex. Only client-slot pairs valid in the layout are considered. A region can be blank, and several regions can expose one endpoint. An endpoint can remain live with no incident client. When two occurrences display different regions of the same endpoint, their sampling maps record which cells they expose. A policy records which administrative operations and ordinary inputs are enabled, a rule for resolving recipients and encoding effects, and the scopes of focus, visibility, size, and retention. Read-only attachments, layout-only operations, synchronization, and raw relays can all be expressed by changing these data. A visible plug-in or status line can occupy a slot as an explicit overlay or as an endpoint with its own type.
A family of tagged transitions xex′ describes commands, application and device steps, client arrivals and departures, and samples at the chosen observation boundary. It can include side effects in the label or the store. When applying the support test, encode each observable effect order in the store or verify interchange separately for the retained effect labels. A transition that allocates may introduce new endpoint names. Deletion can remove them. Comparisons across such boundaries use a partial identification of surviving objects or explicit generative IDs. Nothing requires a fixed set of capabilities in all implementations. Give each system its available action alphabet, and choose an interface on their common tests when comparing two systems. Nondeterminism can be retained in the transition graph. Determinism is required only for results that explicitly assume a deterministic adapter or event update.
Interpretation of tmux.
Use the layout leaves as slot labels available to each client displaying that window, compose attachment and selection with the corresponding window link, and assign each displayed terminal slot its pane’s backing endpoint. Pan and zoom change which cells are exposed. Take shared focus from the window or current window from the session as appropriate. A relative input may consult focus, while an explicit ID can bypass that lookup. This interprets the earlier equations in the general interface. GNU Screen can expose a slot with no ordinary shell endpoint. A model of dtach can take a single live endpoint and omit a retained cell grid. Thus the construction does not force a window hierarchy, tiling, or server-side emulation.
Composing two routing layers
Consider a client running an inner multiplexer in an outer pane. For a fixed routing epoch, choose an input that passes the outer key decoder. Let A be the set of input origins, B the interface ports wired to the next layer, and D the final recipients. Distinguish routes even when they have the same ends. Two route tables are then finite spans AHtB,BsKD. A route of the composite is a pair (h,k)∈H×BK satisfying t(h)=s(k). The identity routing table on A has one route a from each a to itself. These are the composition and identity of the bicategory of spans, here with isomorphisms of route tables as the reversible 2-cells [11]. The associator sends ((h,k),l) to (h,(k,l)). For four layers each composite around the pentagon simply rebrackets the same compatible tuple, proving coherence directly. These 2-cells compare static descriptions of routing. Execution swaps compare orders of events in time.
Proposition 4 (Multiplicity and reachability under nesting). Let Mab count the routes from a to b in the first layer and Nbd those from b to d in the second. Then the composite route count is the ordinary matrix product (MN)ad=b∈B∑MabNbd. Passing from counts to nonempty reachability commutes with composition if the target uses Boolean matrix multiplication.
Proof. Partition the fibre of the pullback over (a,d) according to its intermediate port b. Each part is the product of the two route fibres, giving the sum of products. The sum is positive exactly when at least one b has both factors positive. This is precisely disjunction over b of the two reachability predicates conjoined. ◻
For example, a source that emits through two ports b1,b2 can reach the same inner endpoint d once through each. The count at (a,d) is two, while the reachable recipient set is {d}. Deduplicating separately at each immediate port leaves both paths to d. For an intended once-per-final-endpoint broadcast, one must know their common destination or have an appropriate idempotence law. This is the nested version of Theorem 1.
This calculation applies when each route under consideration forwards the specified event, the wiring stays fixed during target resolution, and every layer preserves the observed event. For example, an outer command prefix can consume the next key or change the selected pane before the inner layer sees it. A static span of visible panes then overestimates delivery. To handle that case, first step the outer state machine to determine emitted events, then use the inner transitions at the resulting state. Taking a pullback alone cannot predict how either decoder handles a key.
Translations must preserve comparisons as well as commands
For a specified event model build its presented execution (2,1)-category E as in Section 5. Choose a strict target (2,1)-category D, for instance the execution category of another multiplexer. A candidate implementation assigns F(x) to each abstract state x and a finite target path F(x)→F(y) to every generating transition x→y, including device and sample events. To preserve independence, assign each generating swap square an invertible 2-cell between the translated paths, respecting the designated reverse square. An empty target path can implement pure bookkeeping when its source and target state images are equal. Adapters that use hidden intermediate states must specify where the observation boundary is placed.
Proposition 5 (Extension of a translation). Such state, path, and square assignments extend to a strict 2-functor E→D exactly when the translated generating equations hold. For this presentation the nonstructural equations to check are the certified three-event cube equations, together with any additional relations explicitly imposed by the source model. The extension is unique on the given assignments.
Proof. Send a composite path to the concatenation of its images and a pasted comparison to the corresponding pasting, using inverses for reverse swaps. The laws of a strict 2-category handle identities, whiskering and disjoint interchange. The assumed equations then identify the values of any two representatives of a quotient 2-cell. This defines the functor and forces its value on all composites. Conversely, a 2-functor sends every defining equation to an equality. ◻
For fixed geometry, independently updating parsers on two separate devices can be translated to independent updates on the corresponding target devices. If the translator maps every event to a command that also appends a label to a common visible ordered log, swapping two different events changes the log. In the target model retaining that log, the two paths then have different endpoint states. No invertible 2-cell with those boundaries exists. Forgetting the log changes the comparison problem. The extension proposition describes an obligation of a proposed implementation. The assignment on command names alone leaves the swap cells unspecified.
The model has two distinct comparisons of implementations. A translator can carry independent paths to coherently interchangeable paths. An observer can also declare two initial configurations equivalent when all its permitted experiments agree, ignoring internal paths. The marker experiment in Section 9 specifies one family of such experiments. Neither comparison implies all operational details of the other without an explicit observation or lifting hypothesis.
What transfers to other multiplexers?
A portable interface needs distinct names for the place where a user looks, the endpoint that receives input, and the running computation behind that endpoint. The following experiments specify an initial state, an operation and an observation. Their outcomes follow from the cited manuals. They can therefore distinguish candidate translations without assuming that two programs attach the same meaning to the word window.
Splitting a GNU Screen display
Start with a GNU Screen display containing one region and two ordinary shell windows u and v, with u selected. Issue split, move the focus to the new region, and issue select with the number of v. Immediately after the split, the new region shows Screen’s blank window. After the selection, it shows the shell already running in v. Removing that region leaves v available for selection again. Screen documents window creation under the separate command screen [7].
Let r count visible regions on this display and e count live shell endpoints in the session. Under the stated trace, and with both shells remaining alive, the pairs are (1,2)⟶(2,2)⟶(2,2)⟶(1,2). The middle arrow includes focusing and selecting. Ordinary successful tmux split-window with a long-lived shell instead increments both the pane count in the visible window and the live shell endpoint count. Consequently a translation sending these two split commands directly to one another cannot preserve the endpoint count after each command. A common operational signature can express both by giving layout refinement, endpoint allocation, and assignment of an endpoint to a visible slot separate effects. A composite implementing a command may make its intermediate states private. In particular, the unbound slot after a Screen split is externally observable, whereas privately allocating a slot while implementing an atomic command introduces no such observation.
Client focus and session resurrection in Zellij
Initialize two writable clients on pane p of a tab with two terminal panes p,q, disable synchronized input, and leave both panes in ordinary input mode. Let client a move its focus to q, then have client b type a distinguishable character. With Zellij’s independent client cursors, b can stay on p. With session mirroring enabled, changing the common focus to q directs the character to q. The observation is the recipient of the character, so identical terminal contents before the input do not collapse the test [8]. Abstractly, for a fixed tab and n clients, the independent focus configurations lie in Pn, where P is its set of focusable panes. A shared focus lies in the diagonal ΔP⊆Pn. For p=q, moving just the first coordinate takes (p,p) to (q,p) outside that diagonal. This gives an explicit obstruction to identifying the two policies while preserving both clients’ input routes.
Zellij also distinguishes attachment to a live session from resurrection after the session exits. Its serialized layout records panes, tabs, and commands. Viewport and scrollback recording are configurable. Under the documented default, a resurrected command awaits confirmation before a fresh invocation [8]. To see why even recording the viewport cannot give general process continuation, let a program read a bit with terminal echo disabled, retain it in memory, clear its display, and wait for a query. The two choices of bit yield identical layout, command, and visible text, yet the program would answer the next query differently. The choice can be made without ever writing the bit to scrollback. Any reconstruction determined by that saved record gives the same reconstructed state in both cases and cannot reproduce both answers. An application-specific resume command can recover further state when the application has recorded it elsewhere.
Attachment without a saved display in dtach
The single-program relay dtach admits multiple attachments, forwards application output to attached terminals, and maintains no terminal emulation grid. An attaching client can request a redraw, including by signalling the application, or can disable that request [9]. Start one client, emit a marker and let the client receive it, then detach. Attach a fresh terminal with redraw disabled while the application is silent. Its live computation survives. The relay has no stored grid from which to reconstruct the old marker for that new terminal. This order of events excludes unread output waiting to be forwarded.
The example separates two specifications that applications often conflate. One speaks about continuity of a computation across changes of client. The other specifies what image a newly attached client can obtain before further application output. The first is meaningful for a raw relay. The second requires a source for that image, such as a retained emulator state or a redraw produced by the application. A comparison that forgets rendering can identify the same live attachment trace in these systems. Enriching the observation with the fresh client’s initial image distinguishes them again.
What can be reconstructed from several views?
Consider two observers of a linked window. One reads through a narrow viewport, the other through a wide one. Screen column 7 can refer to different pane cells on their two displays. Conversely, cells reached through different session names can refer to the same pane cell. To compare these observations one must specify a sampling epoch, a coordinate map, and what equality of readings means.
Fix a structural configuration for one epoch, including pane identities, their sizes, and the coordinate maps used for sampling. Let X be a finite set of canonical addresses. A cell address may have the form (p,i,j) for a pane p, row i and column j. An address for metadata may instead have the form (w,p,active). To observe a client-specific focus, include the client identifier in the address. For each x∈X fix a set Ax of values. For instance, a text-only observation can use a glyph string together with a continuation marker for a wide cell. A style-sensitive observation also records attributes. Equality throughout is equality in the specified Ax.
A client chart consists of local sample positions D, a map q:D→X, and values y(d)∈Aq(d). An observation in this model supplies q separately, for example from a layout and viewport offset. If q has repeated values, the chart descends to q(D) exactly when y is constant on each fibre. Several charts reduce in this way to subsets of X. Client overlays require client-indexed addresses when they matter. If a renderer discards an attribute, equality can be tested on a chosen common quotient of the values by applying the quotient map everywhere. A raw screenshot alone need not identify these coordinates or recover a hidden attribute.
Gluing readings and realizing a server snapshot
Use the site of subsets of X, with inclusions as arrows and jointly covering unions as covers. The presheaf E(U)=x∈U∏Ax restricts by forgetting coordinates. To see that it is a sheaf, choose the value at each x from any chart containing it. Agreement gives independence of this choice and the cover gives uniqueness. Equivalently, E is an object of the topos of sheaves on a finite discrete space, which is equivalent to the category of X-indexed families of sets. This is the ordinary matching-family condition [14].
Let B=∅ be a specified set of admissible snapshots in the fixed configuration, and let o:B→E(X) be the observation function. Write R=o(B) and RU=πUR. The image presheaf U↦RU is separated, since restrictions of any two different vectors disagree somewhere on a cover. Its sections remember which coordinate combinations a single snapshot can exhibit.
Proposition 6 (Realizability on a cover). For a cover U=⋃iUi, every compatible family of individually realizable readings is jointly realizable on U if and only if RU={v∈E(U)∣v∣Ui∈RUi for every i}. On the site of all subsets, the image presheaf is a sheaf if and only if R=∏x∈XR{x}, using the canonical identification of singleton vectors with their values.
Proof. The ambient sheaf identifies compatible local families bijectively with the vectors on the right of (2). Such a vector has a witness b∈B precisely when it belongs to RU. Applying the criterion to the singleton cover of X proves necessity of the product condition. Conversely, if R is the product, every partial vector with allowed coordinates extends by filling the remaining coordinates from any fixed element of R. This gives the criterion on every cover. The observation vector is unique when it exists, while its witness in B may have arbitrary multiplicity. ◻
Equation (2) is the lossless-join criterion for these projections, written as descent [16]. The associated sheaf of the image presheaf allows every combination of individually attainable values because a singleton cover forces exactly those gluings. Thus sheafifying a display model can erase a server invariant.
A focus obstruction with an observed overlap.
Take a single ordinary tmux window with three selectable tiled panes p,q,r, recording the window’s active-pane flag. Query the same window-level notion in all charts. Restrict attention to this field and allow each of the three selections. In the order (p,q,r) the observation relation is R={(1,0,0),(0,1,0),(0,0,1)}. The chart {p,r} can observe (1,0) by selecting p. The chart {q,r} can observe (1,0) by selecting q. Both report r=0. Their unique ambient amalgamation (1,1,0) violates the one-active-pane invariant. Likewise, each proper chart can report an all-zero vector when the selected pane is outside it. For charts covering the window, a compatible family is globally realizable precisely when its union has exactly one positive flag. If the unique positive flag identifies p, selecting p gives a witness. This obstruction applies to simultaneous observations of a common selector. Different timestamps or client-specific selectors describe a different reconstruction problem.
Transporting pane names across anonymous views
A stronger observer may record how local names correspond instead of assuming persistent server identifiers. Consider an auxiliary observation graph K. A vertex represents a view with n distinguishable slots, and an edge represents a proposed bijection of slots across two views. This model applies to comparisons for which such a bijection is part of the data. It can be used, for example, by a recorder that has discarded pane IDs. In a comparison of subsets one first restricts the charts to the common tracked slots.
Fix G=Sn and one orientation per edge. On a subgraph H define a groupoid T(H). An object assigns te∈G to every edge, with teˉ=te−1 on reversal. An arrow t→t′ consists of a change hv∈G at each vertex such that, for e:v→w, te′=hwtehv−1. These are the functors from the free path groupoid of H to the one-object groupoid BG, with natural isomorphisms. Use the site of subgraphs with union covers, so an edge belongs to a chart together with both its endpoints.
Proposition 7 (Descent of name transports). Restriction from T(H) to coherent descent data on any subgraph cover of H is an equivalence of groupoids. On a connected nonempty H, a transport is isomorphic to the constant identity transport if and only if every closed path has identity product.
Proof. An arrow on H is determined by its vertex elements. Compatible local arrows glue vertex by vertex, and their edge equations hold wherever the corresponding edge is covered. For objects, suppose charts Hi carry transports ti and overlap isomorphisms hij:ti→tj obeying hjkhij=hik. For each vertex v, choose a chart i(v) containing it. On a chart i use the gauge hvi,i(v) at v. The transformed labels agree for each edge in two charts by the edge equations and the vertex cocycle. They define a global transport and the chosen gauges exhibit the required isomorphism to its restrictions. Finally label a spanning tree starting at a root, propagating an initial frame by edge products. Each remaining edge respects the propagated frames exactly when its associated fundamental cycle has identity product. A global change of frames conjugates the product around any loop, which proves the converse. ◻
For three views arranged in a triangle with two tracked slots, label two edges by the identity and the third by a transposition. This defines a global transport whose loop exchanges the two names. On each edge separately the change is removable by choosing endpoint frames. A global consistent numbering exists precisely when the loop product is identity. The obstruction concerns the additional choice of numbering. Descent of the transports themselves still holds, and retains the overlap isomorphisms that a set of local isomorphism classes would discard [15]. If every chart was produced from the same stable pane IDs and every correspondence used those IDs, every loop product would be identity. A nonidentity loop can therefore expose inconsistent proposed correspondences in a recorder.
Behavioral equivalence and the recovery of sharing
A migration tool may reconstruct two identical terminal images and still change what the user can do. Consider a session handle in each of two sessions. In the first configuration the handles address the same one-pane window. In the second they address separate windows occupied by identical copies of a test application. The two app instances can start with identical cell contents. A subsequent edit through one handle can nevertheless distinguish the configurations. This distinction depends on the operations available to the observer.
Comparing through a common interface
Fix an action alphabet A and an observation set O. An adapter maps abstract handles to implementation-specific targets and translates actions into commands, bytes, or controlled environment steps. Its observation map might return pane contents stripped of borders and status lines. It might instead expose raw control-mode events. These choices define different comparisons. For the following result an adapter exposes a set X of observation-boundary states, a map o:X→O, and a partial deterministic transition d:X×A⇀X. Every trial must reach a chosen observation boundary or return a recognizable refusal in finite time. Any scheduler, process input, and asynchronous delivery decisions needed for determinacy are fixed or supplied as actions. Terminal application exit can be recorded as a distinguished observation in O. Timing and internal divergence fall outside this experiment. Where retries after errors matter, the adapter can return an error observation together with an ordinary successor.
For a test that stops at the first refusal, adjoin one absorbing state ⊥ to X, send undefined transitions to it, and give it the fresh observation refused. Write dˉ,oˉ for the resulting total maps. The behavior of x is the function on finite action words bx(w)=oˉ(dˉ∗(x,w))(w∈A∗), where dˉ∗ iterates from left to right with dˉ∗(x,ϵ)=x. Every intermediate observation occurs as the value at a prefix. This is the usual deterministic Moore coalgebra. Its behavior space consists of functions A∗→O⊔{refused}, with observation at ϵ and a-successor fa(w)=f(aw) [17].
Proposition 8 (Finite experiments). Two adapted states have the same behavior if and only if they belong to a relation R on the two totalized state sets such that (x,y)∈R⟹oˉX(x)=oˉY(y),(dˉX(x,a),dˉY(y,a))∈R(a∈A).
Proof. If such an R exists, induction on word length keeps the successor pair in R and gives equality of observations. Conversely take all pairs satisfying bx=by. The empty word gives equal present observations, and evaluation on aw gives equality of the successor behaviors for every a. This also proves that behavior equality is the largest such relation. ◻
Relational composition preserves the displayed conditions because the intermediate state supplies a witness both before and after each action. Comparisons therefore compose when all adapters use the same interface and observation boundary. The result applies to finite adaptive tests because equal prefix observations make such a tester choose the same next action at each step. It proves an equivalence of observable behaviors. Transporting specified interchange cells in an execution model requires additional data about which pairs of actions may be interchanged.
How many writes reveal an alias?
Take n≥1 persistent, named handles in a quiescent test fixture. Each handle addresses exactly one backing terminal, giving an unknown partition π of the handles. The fixture presents a designated marker cell from each handle. Initially all these cells are blank. A successful probe at handle i writes a fresh marker through a cooperating application at its backing terminal and waits until the marker can be read. It changes exactly the marker cells of the handles addressing that terminal. Between probes the observer may read the entire vector of markers. Identity queries, broadcast input, and external writers are outside this interface. Handles in different sessions that refer to the same linked one-pane window supply one realization of the sharing pattern.
Theorem 9 (Identifiability and worst-case cost). Distinct sharing partitions give distinct behaviors at this interface. Identifying an arbitrary partition with certainty requires exactly n−1 single-handle writes in the worst case, with unrestricted marker reads.
Proof. The positions carrying the new marker after a write to i form precisely its block [i]π. Probe one unclassified handle, record the whole block, and remove it from consideration. When at most one handle remains its membership is determined. Each write classifies at least one handle, giving the upper bound and identifiability. For the lower bound, run an exact tester on the partition into singletons. If it stops after fewer than n−1 writes, there exist two handles it has never written. Merge just those two blocks. Every chosen write still changes precisely its original cell, and all reads still agree. Induction over the observed transcript gives the same choices and the same answer for both partitions. They require different answers. The case n=1 uses zero writes. ◻
For two handles the separating word consists of a single write, observed through the second handle. Raw pane IDs, if exposed, can reveal sharing with zero writes. Conversely, two applications that intentionally replicate the marker can mimic a shared terminal. The theorem recovers an alias partition from its stipulated intervention law. A real diagnostic must establish that law for its fixture before interpreting the result as evidence about process or terminal identity.
Experiments and reproducibility
We tested a live tmux server, the kernel interface to a pseudoterminal, and a finite marker machine whose alias relation is known to the checker. Each boundary exposes different evidence for the preceding results.
A live server with two sessions and three clients
We exercised an unmodified Debian tmux 3.5a-3 executable in an x86-64 Linux 6.12.115-0-virt guest with Python 3.13.5. The test starts a private server with an empty configuration, opens two sessions, and attaches two control clients to alpha and one to beta. A shell with terminal echo disabled prints a response for each completed input line. This makes seeing a marker evidence of the workload processing the line. Each observation uses a tmux command with an explicit target where applicable. Two fresh guest boots completed all assertions. Their records agreed except for the operating system-assigned PID (434 and 435). Table 1 gives the recorded values from one run. IDs in subsequent installations can differ.
Observed tmux transitions. Window and pane IDs carry tmux’s literal prefixes. A capture reads the server’s stored pane contents.
Operation or condition
Observation
Link alpha:0 at beta:7
Distinct sessions $0 and $1 gave the same window @0, pane %0, and initial pane PID 435.
Select alpha:1
The clients’ window IDs changed from (@0,@0,@2) to (@1,@1,@2).
Send one via beta:7
Captures via both links contained the single application response PROCESSED one.
Detach all three, release gate
Attached-client lists were empty before and after the producer wrote OUTPUT-WHILE-DETACHED. Reattachment preserved the pane ID, pane PID, and captured lines across that step.
Unlink beta:7
The other three indexed links remained. Sending a new line through alpha:0 produced PROCESSED two.
The gate matters. The producer first printed ARMED and then waited for a filesystem marker. The harness waited for all persistent control clients to exit before creating that marker. Short-lived administrative clients queried the server. This ordering shows that new output was processed during the detached interval. An unchanged capture would provide weaker evidence. The result establishes continuity for the observed interval under the tested configuration. It cannot tell us what a server configured to terminate on its last detach would do.
The same fixture also tests an independence prediction. Reset the names of windows at alpha:0 and beta:0 to initial. Preparing one rename to left and one to right, run the two possible orders, resetting names before each trial. With targets alpha:0 and beta:0, both orders ended at (left,right). With targets alpha:0 and beta:7, the orders ended at (right,initial) and (left,initial). Distinct textual targets were insufficient to infer commutation. The observation here is the final pair of window names. Counting all ordered rename notifications could distinguish even the first two executions.
Two further predictions.
A second fixture exposed one pane as count:0 and beta:8. Sending the same literal line once per resolved pane produced one PROCESSED repeat response. Traversing both handles and sending once per handle produced two responses. Ordered end markers delimited the trials, and terminal echo was disabled. This is a live witness to the failure of idempotence for literal input in Theorem 1.
For the focus example, we selected each of three ordinary tiled panes and queried the three window-level active flags in a fixed pane order. The three resulting rows were 100,010,001. Restricting the first to {p,r} and the second to {q,r} produced (1,0) twice. Their common cell value at r admits an ambient gluing 110, which violates unique focus. The restrictions were sampled from two different selections on purpose. The calculation asks whether their values could have come from a single selection.
PTY effects and finite enumeration
A separate Linux test used kernel 6.18.57 and Python 3.12.14. With canonical mode enabled and echo disabled, writing abc to a PTY master left a nonblocking slave read at EAGAIN. Adding a newline made the line abc followed by that newline available. For the resize test, a foreground child on a controlling PTY blocked and waited for SIGWINCH. Changing the geometry from (0,0) to (37,101) delivered the signal, and the child read back 37 rows and 101 columns. The two independent probes support the placement of buffering and size feedback in Section 2.
The finite enumeration fixes the marker model of Section 9. For each partition on a labelled set it repeatedly probes the least unclassified handle until at most one remains. For n=1,…,8 the counts of partitions recovered were 1,2,5,15,52,203,877,4140, a total of 5,295 instances. The maximum number of writes for each n was n−1. On the singleton execution, merging each possible pair still untouched at each eligible prefix produced 210 comparisons with identical observed prefixes. The enumeration checks one concrete algorithm. The lower bound for arbitrary exact adaptive testers follows from the indistinguishability proof.
The source bundle contains the full manuscript, a journal-length text, and three Python scripts with their recorded JSON results. The tmux probe takes an optional executable path. Its README lists the Unix prerequisites. The PTY probe requires a Linux environment with a controlling PTY facility. The partition enumeration uses only the Python standard library.
Conclusion
A terminal multiplexer can preserve one computation while exposing it through several names, views, and command contexts. For a controller, the kernel pair of the address map says which visits can repeat a side effect. For a scheduler, the same identification says which apparently distinct commands may compete for one resource. For an observer who lacks object IDs, the marker experiment shows exactly how many interventions can reveal the hidden sharing under an explicit application contract. These three uses of the same partition connect the structure of tmux’s window links to an operational test.
A full interoperability claim must also choose its observations. Agreement of sampled cells has a gluing law. Realizability by one server additionally enforces constraints such as unique focus. Process continuation requires information that a display snapshot may omit altogether. The Screen split, Zellij mirror and resurrection policies, and dtach reattachment each distinguish a different one of these obligations. A follow-up mechanization can start with the finite store and ideal construction, the image relation for focus, and the marker-machine lower bound, each of which has explicit inputs and a proof independent of the Unix runtime.
Authorship and automation.
Prepared anonymously for consideration by Higher Categorical Semantics. An AI assistant developed the exposition and mathematical arguments, wrote the probes, and used automated tools to execute and inspect them. The cited manuals document implementation contracts. The supplied scripts and recorded outputs identify the empirical checks. The arguments are provided as written proofs.
References
N. Marriott and tmux contributors. tmux(1), Debian package 3.5a-3. See Clients and Sessions, Windows and Panes, Options, and Control Mode. Debian manual.
K. Winstein and H. Balakrishnan. Mosh: an interactive remote shell for mobile clients. USENIX Annual Technical Conference, 2012. Proceedings.
J. Bénabou. Introduction to bicategories. Reports of the Midwest Category Seminar, Lecture Notes in Mathematics 47, 1–77, 1967. doi:10.1007/BFb0074299.
V. Diekert and A. Muscholl. Trace theory. In D. Padua (ed.), Encyclopedia of Parallel Computing, 2071–2079, 2011. doi:10.1007/978-0-387-09766-4_491.
É. Goubault. Some geometric perspectives in concurrency theory. Homology, Homotopy and Applications 5(2), 95–136, 2003. Journal article.
The Stacks Project Authors. Sites and Sheaves, Definition 7.7.1. Tag 00VM.
The Stacks Project Authors. Stacks, Definition 8.4.1. Tag 026F.
C. Beeri, R. Fagin, D. Maier, A. Mendelzon, J. Ullman and M. Yannakakis. Properties of acyclic database schemes. Proceedings of STOC, 355–362, 1981. Research record.
J. J. M. M. Rutten. Universal coalgebra: a theory of systems. Theoretical Computer Science 249, 3–80, 2000. CWI publication record.
Complete flattened LaTeX source
\documentclass[10pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern,amsmath,amssymb,amsthm,geometry,microtype,booktabs,tabularx,tikz,xcolor,fancyhdr,hyperref}
\usepackage{titlesec}
\geometry{top=.89in,bottom=.88in,left=1.06in,right=1.06in,headheight=14pt,headsep=17pt,footskip=28pt}
\definecolor{ink}{HTML}{172D3C}
\definecolor{sky}{HTML}{237782}
\hypersetup{colorlinks=true,linkcolor=ink,citecolor=sky,urlcolor=sky,pdftitle={A Higher-Categorical Semantics of Terminal Multiplexers},pdfauthor={Anonymous},pdfsubject={Concurrency, terminal multiplexing and observational semantics}}
\urlstyle{same}
\pagestyle{fancy}\fancyhf{}
\fancyhead[L]{\footnotesize\sffamily Terminal multiplexers}
\fancyhead[R]{\footnotesize\sffamily Execution and observation}
\fancyfoot[C]{\small\thepage}
\renewcommand{\headrulewidth}{.25pt}
\titleformat{\section}{\Large\bfseries\color{ink}}{\thesection}{.55em}{}
\titleformat{\subsection}{\large\bfseries\color{ink}}{\thesubsection}{.55em}{}
\titleformat{\paragraph}[runin]{\normalsize\bfseries\color{ink}}{}{0em}{}
\titlespacing*{\section}{0pt}{2.5ex plus 1ex minus .4ex}{1.0ex}
\titlespacing*{\subsection}{0pt}{1.7ex plus .6ex minus .3ex}{.65ex}
\titlespacing*{\paragraph}{0pt}{1.2ex plus .4ex}{.6em}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\setlength{\emergencystretch}{1.1em}
\setlength{\parindent}{1em}
\raggedbottom
\begin{document}
\thispagestyle{plain}
{\noindent\small\sffamily\color{sky} RESEARCH MANUSCRIPT\par}
\vspace{6pt}
{\noindent\fontsize{24}{27}\selectfont\bfseries\color{ink} A Higher-Categorical Semantics\\of Terminal Multiplexers\par}
\vspace{5pt}
{\noindent\large From tmux window links to concurrent executions and local observations\par}
\vspace{8pt}
{\noindent\small Anonymous \hfill 23 November 2026\par}
\vspace{7pt}\hrule\vspace{8pt}
\noindent\textbf{Abstract.}
Two terminal views can agree because they reach the same running computation or because separate computations currently display the same cells. We develop a semantics that separates these cases, beginning with tmux's indexed window links, pane ownership, and scoped focus. A quotient of access paths explains when traversing aliases duplicates an effect. Independent commands generate invertible comparisons between execution paths. For a fixed finite batch with declared resource supports, we prove that all linear extensions of the dependency order reach the same state and have a unique comparison modulo interchange and the three-event cube relation. For simultaneous partial observations, a lossless-join criterion characterizes which matching views can arise from one legal snapshot. At a controlled marker interface we prove that recovering a sharing partition on $n$ handles requires exactly $n-1$ writes in the worst case. A live tmux experiment and comparisons with GNU Screen, Zellij and dtach distinguish persistence, display reconstruction, and process identity.
\par\vspace{4pt}
\noindent{\small\textit{Keywords.} terminal multiplexer, tmux, trace theory, 2-category, sheaf descent, behavioral equivalence.}
\section{Two names for one computation}
Suppose a developer links the build window of a tmux session into a second session for an observer. The observer can watch a compiler already running. If the original session subsequently unlinks its copy of the window, the build can continue in the other session. What, exactly, was copied, and what survived? A model in which sessions are trees of privately owned processes predicts the wrong result. The two terminal images alone cannot settle the question either, since two independent panes can display the same output until a user types into one of them.
This paper takes a terminal multiplexer to be a system that mediates access from one or more terminal-facing clients to logical endpoints over time. Access can be multiplexed across endpoints, clients, or both. A full model distinguishes the address used to reach an endpoint, the one computation it reaches, and the result displayed by a given client. The distinction applies to local and remote clients alike. It also describes the single-endpoint limit in which a relay supplies attachment but has no display model of its own.
Three questions drive the development. If an interface acquires another name for a shared pane, which operations should produce an additional effect? What information must a scheduler retain before exchanging two commands is sound? How much of the shared state can observers reconstruct from terminal views and controlled input? The answers use different categorical structures. A quotient of addresses expresses aliasing. A $(2,1)$-category compares executions that differ by independent swaps. A sheaf glues simultaneous partial readings, and an image relation tests whether a single legal server state could have produced them. Finally, a coalgebraic behavior map records the observations obtainable by finite sequences of tests.
We prove two sharp statements about sharing. Extending a traversal of visible occurrences to repeated aliases preserves a per-endpoint action for arbitrary alias multiplicity exactly when the action is idempotent on the tested states. At a complementary black-box interface, $n-1$ single-handle writes are both sufficient and sometimes necessary to recover the unknown sharing partition on $n$ handles. For the finite-batch coherence result, ordering conflicting operations gives a partial order whose legal schedules have a unique comparison once disjoint squares and the three-event cube equation are imposed. The proof states where this reduction breaks for real clients.
\paragraph{Evidence and scope.}
The operational reference is the tmux 3.5a manual as packaged by Debian. The finite experiments use the same upstream version~\cite{tmux}. Claims about GNU Screen, Zellij, and dtach are derived from their own manuals. Proofs concern explicitly defined models. Captures of a running tmux server, Linux pseudoterminal experiments, and bounded enumeration exercise selected hypotheses. No whole-implementation equivalence is assumed. The underlying mathematics draws on trace theory, geometric concurrency, sheaf descent, and coalgebraic behavior~\cite{trace,goubault,stackssheaf,rutten}. The contribution is the identification of mux resources and observation boundaries for which these tools give checkable results.
A related engineering precedent is Mosh, which synchronizes terminal-emulator state between a server and a roaming client~\cite{mosh}. In that design, two transmissions may bring the client to the same grid after different intermediate states. Our model adds multiple client routes, sharing of application state, and tests of the order in which operations affect shared resources.
\section{A typed operational model of tmux}
\label{sec:operational}
\subsection{Names, window links, and live endpoints}
At a server instant take finite sets $C,S,L,W,P$ of attached or available clients, sessions, session-window links, windows, and panes respectively. A skeletal model for ordinary tiled windows has maps
\[
a:C\rightharpoonup S,\qquad S\xleftarrow{s}L\xrightarrow{w}W,
\qquad o:P\longrightarrow W.
\]
An attached client has a defined $a(c)$. A link $\ell$ has an integer index $i(\ell)$ unique within $s(\ell)$. The pair $(s,i)$ identifies a slot at an instant. The target $w(\ell)$ is the window reached there. Pane ownership is $o$. Each ordinary live pane has a PTY endpoint and a running workload, which may contain multiple processes. Retained dead panes or special empty panes require a partial live-endpoint assignment. Pane IDs and PTY incarnations should be tracked separately across respawn. tmux distinguishes server object IDs from relative target expressions and mutable positions~\cite{tmux}.
A nonempty session selects a link $j(s_0)$ above $s_0$, and an ordinary nonempty window selects a pane $f(w_0)$ above $w_0$. Thus $s j=1_S$ and $o f=1_W$ on these domains. In the ordinary shared-focus case, the pane reached from a client with no explicit target is represented by
\[
c\longmapsto f\big(w(j(a(c)))\big).
\]
Use this formula for the selected pane in our fragment. Full command resolution also depends on the command, its source context, marked panes and target syntax. The \texttt{active-pane} client flag can supply a client-specific selection for the cursor and client commands while hooks and styles can still use window focus. Two clients of one session normally share its current window, while sessions in the same session group can choose different current windows from the group's linked set. A model that scopes all three pointers to the client misroutes ordinary input.
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[x=1.0cm,y=0.94cm,every node/.style={font=\small},box/.style={draw=ink!60,rounded corners=2pt,minimum height=6.5mm,minimum width=14mm,fill=sky!9},arr/.style={->,>=stealth,draw=ink!85,thick}]
\node[box] (a) at (0,0.65) {$s_A$}; \node[box] (b) at (0,-0.65) {$s_B$};
\node[box] (l) at (2.3,0.65) {$\ell_2$}; \node[box] (m) at (2.3,-0.65) {$\ell_7$};
\node[box,fill=sky!18] (win) at (4.9,0) {$w$};
\node[box] (p) at (7.1,0) {$p$}; \node[box] (t) at (9.35,0) {live PTY};
\draw[arr] (l)--(a);\draw[arr] (m)--(b);\draw[arr] (l)--(win);\draw[arr] (m)--(win);\draw[arr] (p)--(win);\draw[arr] (p)--(t);
\node[font=\scriptsize] at (0,1.25){sessions};\node[font=\scriptsize] at (2.3,1.25){indexed links};\node[font=\scriptsize] at (4.9,1.25){window};\node[font=\scriptsize] at (7.1,1.25){pane};
\end{tikzpicture}
\caption{Two links target one window. Traversing either link and then taking the fibre of pane ownership reaches the same pane. Removing one link leaves the other route and its endpoint available.}
\label{fig:alias}
\end{figure}
The set of possible pane occurrences along these routes is the pullback
\[
H=L\times_W P=\{(\ell,p):w(\ell)=o(p)\}.
\]
Taking the fibre over a session selects its occurrences, while projecting $q:H\to P$ forgets the access path. Restricting to one client, viewport, or policy gives a subset of this domain. A view can crop or omit cells within an occurrence. Terminal images and routing plans therefore live over different maps even when they use the same pane IDs.
\subsection{Events and observation boundaries}
The following operations specify a fragment on quiescent boundaries. We suppress hooks, asynchronous exits, automatic renumbering and implicit fallback selection unless the operation under discussion needs them. Commands accept valid explicit targets. Empty-session and last-link behavior must be specified when extending the fragment to those cases.
\begin{center}
\small
\renewcommand{\arraystretch}{1.17}
\begin{tabularx}{\linewidth}{@{}p{.235\linewidth}>{\raggedright\arraybackslash}X@{}}
\toprule
Operation & Resource change in the fragment\\
\midrule
\texttt{link-window} & Add a fresh link to an existing window at a free destination. The window, its panes and live workloads retain identity.\\
\texttt{unlink-window} & Remove a named link where another link keeps the window reachable. A selected link requires a new valid selection if the session remains.\\
\texttt{split-window} & For a successful ordinary shell split, refine the window layout, create a pane, allocate a PTY and start the command. Existing links refer to the changed window.\\
\texttt{select-pane} & Change the applicable focus pointer. A later input with a relative target can therefore have a different recipient.\\
\texttt{detach-client} & Remove an attachment. Retention settings, active clients, hooks and size policy determine additional effects.\\
Pane output & Consume bytes at one endpoint, update its terminal parser and grid, and make the resulting state available to eligible observations.\\
\bottomrule
\end{tabularx}
\end{center}
One command can trigger several events. For example, a split can resize an existing application and generate later output. In the full machine, determining a target, queueing bytes, the slave process reading them, parsing its reply and sampling a screen can be distinct steps. A tmux server multiplexes clients through command queues. The observation model determines which intermediate steps to expose. It is permissible to treat an entire command as atomic only for an observer that cannot distinguish the intervening effects.
\subsection{The terminal path in both directions}
Consider the forward path from a physical key to a running program. Client key decoding and a key table may consume a prefix, execute a command, change a mode, or forward data. For the forwarding branch, target resolution selects one or more eligible panes. Encoding depends on terminal modes. The PTY's line discipline can buffer input, echo it, or turn a configured interrupt character into a signal for the foreground process group~\cite{pty}. The word typed, the bytes written to a master, and the sequence the application reads are therefore three distinct observations.
In the reverse direction, parsing output requires more state than the visible grid. At fixed geometry let $T$ contain a terminal's grid, cursor, modes, applicable history, and incomplete parser state. For a chosen deterministic byte parser with no outside effects, writing a string gives a right action of the free monoid $B^*$ of bytes satisfying
\[
\delta(t,\epsilon)=t,\qquad
\delta(t,uv)=\delta(\delta(t,u),v).
\]
The equations follow by folding the single-byte update over the string. With generated replies, extend the state by an ordered reply channel or accumulate the replies under concatenation. The equations concern chunks of an identical ordered stream. They fail for a parser restarted at every chunk boundary. For example, the sequence consisting of ESC, \texttt{[}, \texttt{2}, and \texttt{J} encodes an erase-display instruction in a supporting terminal. The state after ESC and \texttt{[} must survive until the parameters arrive~\cite{ecma,xterm}. Recording every chunk boundary or permitting a timeout between chunks defines a stronger observation.
A client then samples terminal state through a layout, viewport, rendering capabilities, and mode. A \texttt{capture-pane} text snapshot, a client's rendered image with borders or overlays, and a control-mode notification carrying pane output are different data types~\cite{tmux,control}. Joining them by string equality would identify unrelated events. Figure~\ref{fig:observations} marks where the experimenter can insert an observation.
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[x=1cm,y=0.94cm,box/.style={draw=ink!65,rounded corners=2pt,fill=sky!8,minimum height=7mm,align=center,font=\small},arr/.style={->,>=stealth,thick,draw=ink!85}]
\node[box] (k) at (0,0) {client key};
\node[box] (r) at (2.7,0) {router};
\node[box] (m) at (5.6,0) {PTY master};
\node[box] (app) at (8.65,0) {application};
\node[box] (state) at (5.6,-1.3) {parser and grid};
\node[box] (img) at (2.7,-1.3) {client view};
\draw[arr] (k)--(r);\draw[arr] (r)--node[above,font=\scriptsize]{bytes}(m);
\draw[arr] (m) to[bend left=15] node[above,font=\scriptsize]{input} (app);
\draw[arr] (app) to[bend left=15] node[below,font=\scriptsize]{output} (m);
\draw[arr] (m)--(state);\draw[arr] (state)--(img);
\end{tikzpicture}
\caption{Observable boundaries for one target. A keystroke can end at the router. Forwarded input can be held by the line discipline, while a later application reply can change the grid seen by several clients.}
\label{fig:observations}
\end{figure}
\section{Routing through aliases}
\label{sec:routing}
A control program can list panes by traversing the windows of each session. A loop that sends one character to every pane it encounters therefore visits some panes more than once. The same traversal is entirely reasonable for listing what each session can see. The difference has an algebraic explanation.
Restrict the occurrence map to a finite set of intended handles $H_0$ and corestrict it to its image $P_0=q(H_0)$. Denote the resulting surjection by $q_0:H_0\twoheadrightarrow P_0$. In sets, $P_0$ is the coequalizer of the two projections of the kernel pair
\[
H_0\times_{P_0}H_0\ \rightrightarrows\ H_0
\ \xrightarrow{q_0}\ P_0 .
\]
Indeed, a function on $H_0$ takes the same value on each pair in the kernel precisely when one can define its value on $p$ by choosing any handle for $p$. Surjectivity makes this factorization unique. If there is a pane-dependent state set $T_p$, a resource snapshot $(t_p)_{p\in P_0}$ pulls back to the family $(t_{q_0(h)})_h$. In particular, sharing a pane duplicates readings without duplicating that pane's state. Client-specific annotations may differ because they have additional address coordinates.
In the other direction, a set $D\subseteq H_0$ of selected handles determines the set of physical recipients $q_0[D]$. Set image satisfies
\[
q_0[D]\subseteq U\quad\Longleftrightarrow\quad
D\subseteq q_0^{-1}[U].
\]
This adjunction on power sets gives a canonical once-per-recipient interpretation of a uniform broadcast. Repeating a handle has no effect on the recipient set. Emitting an action while traversing a list of handles implements a different semantics.
\begin{theorem}[Alias invariance of traversal]
\label{thm:alias}
Fix an endpoint state space $T$ and an action with deterministic local effect $F:T\to T$. An observer can distinguish different values of $T$. Endpoints are independent during the command and each visit applies $F$ once. Over all finite nonempty fibres and initial states, a visit to every handle gives the same endpoint state as one application per distinct endpoint if and only if $F^2=F$.
\end{theorem}
\begin{proof}
An endpoint with $k$ selected aliases ends at $F^k(t)$. Two aliases for one endpoint and arbitrary $t$ force $F^2(t)=F(t)$. Conversely that identity implies $F^k=F$ for $k\geq1$ by induction. Endpoints with no selected handles are unchanged by both semantics. Independence lets us apply the calculation separately to each coordinate.
\end{proof}
If a fixed command sets a field to a constant, its effect on that field satisfies the theorem. If updating it twice emits two notifications and the observer counts them, the enlarged state need no longer be idempotent. For queued literal input $u$ use the word-valued state $T=B^*$ with $F(t)=tu$. For $u\ne\epsilon$, $tuu$ differs from $tu$ even at $t=\epsilon$. A controller that logs its writes to the master can see the difference, as can a cooperating raw-mode slave reader after delivery. Conversely, a coarse observation can hide the second copy. Applying the theorem on a quotient requires a well-defined induced endomorphism there. This result concerns an occurrence-enumerating controller. tmux's own \texttt{synchronize-panes} operates within the window on other eligible panes with synchronization enabled, subject to pane modes~\cite{tmux}. It does not traverse every link in every session.
\paragraph{A worked command trace.}
Assume two independently named sessions $A,B$, with ordinary live panes, and let $w$ initially belong to $A$. Keep an unrelated guard window in each session when needed so that both remain nonempty. Link $A$'s window at a free slot of $B$. Resolve the shared pane via the two links and record equal pane IDs. Direct one marker input to the first handle and read both. A cooperating process in $p$ emits the marker once, and after the update both reads can see it. Now perform the same command by visiting both occurrences and writing on each visit. This time the input queue gets two copies. Unlink $A$'s link while $B$ retains its link. Now only $B$ still addresses $p$ via the illustrated pair. The operations distinguish site of observation, multiplicity of input, and lifetime of the process.
The alias quotient also determines how to compute read and write supports. Two loops that write to syntactically distinct session targets can still write to one input queue. A comparison of target strings misses the conflict. Appending \texttt{a} then \texttt{b} can produce \texttt{ab}, while reversing them can produce \texttt{ba}. Resolve the targets to backing resources and include the state consulted during resolution. The resulting criterion is developed in Section~\ref{sec:mux-concurrency}.
\section{Detach, resize, and the boundary of persistence}
\label{sec:lifetime}
In a restricted server model write a state as $(k,v)$, with $k$ the core and $v$ the clients' attachment and view state. Include PTY identities, application state relevant to the observer, and retained parser and grid data in $k$. Let $U(k,v)=k$ forget the views. A client change $d$ is transparent to this observation at $x$ if $U(d(x))=U(x)$. Changing geometry in the kernel, killing a last session, or delivering an application-visible focus event may violate this equality.
\begin{proposition}[Erasing attachment bookkeeping]
Fix a finite executed schedule. Suppose every client-only step preserves $U$. For each core event $e$ with fixed data, suppose its enabledness depends only on $U(x)$ and it has a deterministic projected update $\widehat e$ satisfying $U(e(x))=\widehat e(U(x))$ whenever enabled. Projecting the schedule to its core events gives an executable path on core states with the same projected final state. Two schedules starting from the same core and having the same ordered core events then end in equal cores.
\end{proposition}
\begin{proof}
Induct along the schedule. A client-only step leaves the induction invariant unchanged. At a core step, core-dependent enabledness permits the projected transition and the stated equation identifies its successor with the next projection. The initial core and the projected word determine its final state.
\end{proof}
For a detached compiler this law allows continued computation while no clients are present. Application steps and PTY output still occur in the projected word. Reattachment can therefore display a later state of the same computation. The proposition does not assert that a detached and attached run will receive the same inputs, timers or scheduler decisions. These are assumptions to check when comparing the two words.
In tmux, \texttt{exit-unattached}, \texttt{destroy-unattached}, hooks, and window sizing policy are relevant to the premises~\cite{tmux}. Consider a window whose size tracks the smallest eligible attached client. Attach a second smaller client under that policy, with both clients displaying the window and contributing their sizes. Adjusting the PTY can deliver \texttt{SIGWINCH} to its foreground process group on Linux~\cite{winsz}. An application can print its new geometry in response. The client-only interpretation now fails at the resize, and the further output has an identifiable cause. A client viewport moving over unchanged backing cells is a different operation, which need not resize the PTY. Removing a client, restarting a server, respawning a pane, and rerunning a saved command are likewise different proposed implementations of persistence. Section~\ref{sec:other-multiplexers} supplies an example in which a saved command omits a private bit of application memory.
\section{Independent edits and the groupoid of schedules}
\label{sec:mux-concurrency}
Suppose that one output chunk arrives on each of two panes. An observer who polls both panes after the two updates may see the same result in either order. An observer who records each arrival on a common time line can distinguish the orders. A client that samples the display between the updates supplies a third event whose dependencies must be recorded. The choice of observation therefore enters the construction of an execution square. Partial commutation of words is classical in trace theory \cite{trace}, and cubes for independent transitions have a geometric interpretation in concurrency theory \cite{goubault}. We specify the resources that justify applying those constructions to a terminal server.
\subsection{A test for a commuting square}
Fix an interval of modeling and an abstract store $X=\prod_{r\in D}X_r$. Its coordinates may include a pane's parser state, its pending input, a session's current-window pointer, or an ordered output channel. An event occurrence $e$ has a name, a guard, read support $R_e\subseteq D$, and write support $W_e\subseteq D$. The guard and all new values depend only on the old values on $R_e$, with external data such as an arriving byte string fixed as part of $e$. A successful update fixes all other coordinates. Include a coordinate in $R_e$ when its new value uses its old one. Represent emitted effects by updating the corresponding channel histories in the store, at the granularity the observer retains. In particular, an ordered log shared by two operations is a shared resource. Every event has a definite target. Resolving a relative pane target requires reading the selection on which that resolution depends.
A sufficient condition for two occurrences $e,f$ to commute is
\begin{align}
W_e\cap (R_f\cup W_f)&=\varnothing,\nonumber\\
W_f\cap (R_e\cup W_e)&=\varnothing.\label{eq:mux-support}
\end{align}
Indeed, if $ef$ can run, $f$'s guard already held before $e$ ran. Running $f$ first preserves $e$'s guard and all the values $e$ will use. The two final stores coincide coordinate by coordinate. The converse follows by symmetry. Here and below, juxtaposition denotes execution in written order. Two writes of the same constant can commute even when the support test fails.
Consider the parser update for a known output chunk on pane $p$. If it reads and writes only $p$'s terminal state, a similar update for $q\ne p$ passes the test. This statement is about the parser stage with independently indexed terminal state. Adding a shared arrival log, an effect on a shared clipboard, or an intervening observation may change the answer. A second instructive pair consists of selecting pane $q$ and sending a key to the active pane. When $p$ was active, the two orders deliver the key to different endpoints. An input event using an explicit target can avoid that particular read. Its other effects still need their own supports.
\subsection{Paths, swaps, and their equations}
Generate a strict $(2,1)$-category as follows. Its objects are stores and its 1-arrows are finite paths of enabled transitions, including the empty path. For each certified unordered pair at a given store, choose one orientation of its commuting square and adjoin an invertible 2-arrow between the paths $ef$ and $fe$. Paths keep separate names for repeated occurrences. A 2-arrow can be applied inside a larger path by prefixing or suffixing the same transitions. Impose the interchange law for swaps in disjoint positions and the following equation whenever three independent events can be executed in all six orders with the stated squares. If $s_i$ exchanges the events in positions $i,i+1$, the equation for the two composites from $abc$ to $cba$ is
\[
s_1s_2s_1=s_2s_1s_2.
\]
\begin{figure}[tb]
\centering
$\begin{array}{ccccc}
& bac & \longrightarrow & bca & \\
\nearrow & & & & \searrow \\
abc & & & & cba \\
\searrow & & & & \nearrow \\
& acb & \longrightarrow & cab &
\end{array}$
\caption{Three output chunks $a,b,c$ on independent endpoints. Each vertex is a complete execution order. Each edge swaps one pair. The cube equation equates the upper and lower comparisons.}
\label{fig:mux-braid}
\end{figure}
The indices here refer to the current word at each step. Figure~\ref{fig:mux-braid} displays the two comparisons. Geometrically the six words are the six directed edge paths across a three-dimensional execution cube. Its six square faces give the six swaps in the displayed equation. We use this cube as an equation between pastings of 2-arrows. The 1-arrows $ef$ and $fe$ remain distinct ordered paths, even when joined by a swap. Inverting that 2-arrow gives a comparison of the same executions in the reverse direction.
\subsection{Coherence for a finite batch}
Take one executable word $w$ from store $x$ with finite set $E$ of distinctly named occurrences. Order every pair failing \eqref{eq:mux-support} by its order in $w$, add any specified program-order constraints consistent with $w$, and take transitive closure. This defines a poset $P$ on $E$. Within this batch, the admissible schedules are the linear extensions of $P$, and the permitted comparisons exchange adjacent incomparable occurrences. Additional program-order constraints can intentionally keep even commuting actions ordered. Write $\mathcal L(P)$ for the groupoid generated by these swaps, with cancellation, disjoint interchange, and the three-event equation above.
\begin{theorem}[Finite-batch schedule coherence]
\label{thm:mux-schedules}
Every linear extension of $P$ executes from $x$ to the same modeled store. Between any two extensions there is exactly one arrow in $\mathcal L(P)$. More generally, every order ideal $J$ of $P$ determines a store $x_J$ independent of the schedule used to reach it.
\end{theorem}
\begin{proof}
Choose a reference extension $u$ and rank the occurrences by their positions in $u$. In any extension unequal to $u$, an adjacent inverted pair exists. The two elements are incomparable, since otherwise their relative order would agree in both extensions. Swapping them preserves the extension and decreases the inversion count by one. Thus every extension reaches $u$. Taking $u=w$ and running the swaps backwards from $w$ proves executability and endpoint equality by the support test.
For uniqueness, orient swaps towards lower inversion count. Compare two possible first reductions. Identical reductions need no comparison. Reductions in disjoint positions yield a square by interchange. Overlapping reductions begin with three ranks in strictly decreasing order. The three occurrences are pairwise incomparable because each pair has opposite orders in the current extension and in $u$. Both first reductions therefore extend through valid decreasing swaps to the reversed triple. The two pastings agree by the three-event equation. An induction on inversion count now equates any two decreasing paths to $u$ by continuing from the join to $u$ and applying the induction hypothesis at each immediate successor. Denote the resulting normalization arrow by $n_v:v\to u$. For every decreasing generator $t:v\to v'$, $n_v$ is $t$ followed by $n_{v'}$. Invertibility gives the corresponding identity for increasing generators. Consequently any zigzag from $v$ to $v'$ equals $n_v$ followed by $n_{v'}^{-1}$.
Every extension of $J$ is a prefix of an extension of $P$, since $J$ is downward closed. All its orders are executable by the first assertion and are joined by swaps inside that prefix, proving independence of $x_J$.
\end{proof}
For an ideal $J$ and an occurrence $e$ minimal outside it, executing $e$ at $x_J$ yields $x_{J\cup\{e\}}$. Thus the poset of ideals indexes intermediate stores and the scheduling groupoid controls comparisons of paths between them. For example, let $a,c$ append successive chunks to the history of $p$, while $b$ appends to $q$. The only constraint is $a<c$. Its three completed schedules are $acb,abc,bac$. A test that depends only on the completed pair of histories needs one representative. A test that reads $q$ immediately after $a$ introduces a read event whose order relative to $b$ can affect the result.
The theorem permits hidden implementation steps only to the extent justified by the chosen atomic events. In particular, a size change can trigger process output. Treating the resize and the response as separate events exposes their causal order. A test of independence at a single initial state cannot generally justify a cube. In a store with two free slots, three allocation requests can each be paired successfully, yet no ordering of all three succeeds. Equation \eqref{eq:mux-support} records their common capacity coordinate. Dynamic aliasing, allocation, or policies that select a target when a command runs require similar attention before reordering commands. The theorem supplies a reduction for specified finite schedules and observations. It asserts neither scheduler fairness nor conformance of every tmux command to a particular choice of atomic steps.
\section{A general multiplexer and maps between implementations}
\label{sec:gen}
We now free the construction from the incidence diagram of tmux. A \emph{multiplexer specification} consists of a state-indexed interface. Each state $x$ has clients $C_x$, slot labels $V_x$, backing endpoints $E_x$, and an incidence relation
\[
I_x\ \subseteq\ (C_x\times V_x)\times E_x .
\]
Only client-slot pairs valid in the layout are considered. A region can be blank, and several regions can expose one endpoint. An endpoint can remain live with no incident client. When two occurrences display different regions of the same endpoint, their sampling maps record which cells they expose. A policy records which administrative operations and ordinary inputs are enabled, a rule for resolving recipients and encoding effects, and the scopes of focus, visibility, size, and retention. Read-only attachments, layout-only operations, synchronization, and raw relays can all be expressed by changing these data. A visible plug-in or status line can occupy a slot as an explicit overlay or as an endpoint with its own type.
A family of tagged transitions $x\xrightarrow{e}x'$ describes commands, application and device steps, client arrivals and departures, and samples at the chosen observation boundary. It can include side effects in the label or the store. When applying the support test, encode each observable effect order in the store or verify interchange separately for the retained effect labels. A transition that allocates may introduce new endpoint names. Deletion can remove them. Comparisons across such boundaries use a partial identification of surviving objects or explicit generative IDs. Nothing requires a fixed set of capabilities in all implementations. Give each system its available action alphabet, and choose an interface on their common tests when comparing two systems. Nondeterminism can be retained in the transition graph. Determinism is required only for results that explicitly assume a deterministic adapter or event update.
\paragraph{Interpretation of tmux.}
Use the layout leaves as slot labels available to each client displaying that window, compose attachment and selection with the corresponding window link, and assign each displayed terminal slot its pane's backing endpoint. Pan and zoom change which cells are exposed. Take shared focus from the window or current window from the session as appropriate. A relative input may consult focus, while an explicit ID can bypass that lookup. This interprets the earlier equations in the general interface. GNU Screen can expose a slot with no ordinary shell endpoint. A model of dtach can take a single live endpoint and omit a retained cell grid. Thus the construction does not force a window hierarchy, tiling, or server-side emulation.
\subsection{Composing two routing layers}
Consider a client running an inner multiplexer in an outer pane. For a fixed routing epoch, choose an input that passes the outer key decoder. Let $A$ be the set of input origins, $B$ the interface ports wired to the next layer, and $D$ the final recipients. Distinguish \emph{routes} even when they have the same ends. Two route tables are then finite spans
\[
A \xleftarrow{} H \xrightarrow{t} B,\qquad
B \xleftarrow{s} K \xrightarrow{} D .
\]
A route of the composite is a pair $(h,k)\in H\times_B K$ satisfying $t(h)=s(k)$. The identity routing table on $A$ has one route $a$ from each $a$ to itself. These are the composition and identity of the bicategory of spans, here with isomorphisms of route tables as the reversible 2-cells~\cite{benabou}. The associator sends $((h,k),l)$ to $(h,(k,l))$. For four layers each composite around the pentagon simply rebrackets the same compatible tuple, proving coherence directly. These 2-cells compare static descriptions of routing. Execution swaps compare orders of events in time.
\begin{proposition}[Multiplicity and reachability under nesting]
Let $M_{ab}$ count the routes from $a$ to $b$ in the first layer and $N_{bd}$ those from $b$ to $d$ in the second. Then the composite route count is the ordinary matrix product
\[
(MN)_{ad}=\sum_{b\in B}M_{ab}N_{bd}.
\]
Passing from counts to nonempty reachability commutes with composition if the target uses Boolean matrix multiplication.
\end{proposition}
\begin{proof}
Partition the fibre of the pullback over $(a,d)$ according to its intermediate port $b$. Each part is the product of the two route fibres, giving the sum of products. The sum is positive exactly when at least one $b$ has both factors positive. This is precisely disjunction over $b$ of the two reachability predicates conjoined.
\end{proof}
For example, a source that emits through two ports $b_1,b_2$ can reach the same inner endpoint $d$ once through each. The count at $(a,d)$ is two, while the reachable recipient set is $\{d\}$. Deduplicating separately at each immediate port leaves both paths to $d$. For an intended once-per-final-endpoint broadcast, one must know their common destination or have an appropriate idempotence law. This is the nested version of Theorem~\ref{thm:alias}.
This calculation applies when each route under consideration forwards the specified event, the wiring stays fixed during target resolution, and every layer preserves the observed event. For example, an outer command prefix can consume the next key or change the selected pane before the inner layer sees it. A static span of visible panes then overestimates delivery. To handle that case, first step the outer state machine to determine emitted events, then use the inner transitions at the resulting state. Taking a pullback alone cannot predict how either decoder handles a key.
\subsection{Translations must preserve comparisons as well as commands}
For a specified event model build its presented execution $(2,1)$-category $\mathcal E$ as in Section~\ref{sec:mux-concurrency}. Choose a strict target $(2,1)$-category $\mathcal D$, for instance the execution category of another multiplexer. A candidate implementation assigns $F(x)$ to each abstract state $x$ and a finite target path $F(x)\to F(y)$ to every generating transition $x\to y$, including device and sample events. To preserve independence, assign each generating swap square an invertible 2-cell between the translated paths, respecting the designated reverse square. An empty target path can implement pure bookkeeping when its source and target state images are equal. Adapters that use hidden intermediate states must specify where the observation boundary is placed.
\begin{proposition}[Extension of a translation]
Such state, path, and square assignments extend to a strict 2-functor $\mathcal E\to\mathcal D$ exactly when the translated generating equations hold. For this presentation the nonstructural equations to check are the certified three-event cube equations, together with any additional relations explicitly imposed by the source model. The extension is unique on the given assignments.
\end{proposition}
\begin{proof}
Send a composite path to the concatenation of its images and a pasted comparison to the corresponding pasting, using inverses for reverse swaps. The laws of a strict 2-category handle identities, whiskering and disjoint interchange. The assumed equations then identify the values of any two representatives of a quotient 2-cell. This defines the functor and forces its value on all composites. Conversely, a 2-functor sends every defining equation to an equality.
\end{proof}
For fixed geometry, independently updating parsers on two separate devices can be translated to independent updates on the corresponding target devices. If the translator maps every event to a command that also appends a label to a common visible ordered log, swapping two different events changes the log. In the target model retaining that log, the two paths then have different endpoint states. No invertible 2-cell with those boundaries exists. Forgetting the log changes the comparison problem. The extension proposition describes an obligation of a proposed implementation. The assignment on command names alone leaves the swap cells unspecified.
The model has two distinct comparisons of implementations. A translator can carry independent paths to coherently interchangeable paths. An observer can also declare two initial configurations equivalent when all its permitted experiments agree, ignoring internal paths. The marker experiment in Section~\ref{sec:refinement} specifies one family of such experiments. Neither comparison implies all operational details of the other without an explicit observation or lifting hypothesis.
\section{What transfers to other multiplexers?}
\label{sec:other-multiplexers}
A portable interface needs distinct names for the place where a user looks,
the endpoint that receives input, and the running computation behind that
endpoint. The following experiments specify an initial state, an operation
and an observation. Their outcomes follow from the cited manuals. They can
therefore distinguish candidate translations without assuming that two
programs attach the same meaning to the word \emph{window}.
\subsection{Splitting a GNU Screen display}
Start with a GNU Screen display containing one region and two ordinary
shell windows $u$ and $v$, with $u$ selected. Issue \texttt{split}, move
the focus to the new region, and issue \texttt{select} with the number
of $v$. Immediately after the split, the new region shows Screen's blank
window. After the selection, it shows the shell already running in $v$.
Removing that region leaves $v$ available for selection again. Screen
documents window creation under the separate command
\texttt{screen}~\cite{screen}.
Let $r$ count visible regions on this display and $e$ count live shell
endpoints in the session. Under the stated trace, and with both shells
remaining alive, the pairs are
\[
(1,2)\longrightarrow(2,2)\longrightarrow(2,2)\longrightarrow(1,2).
\]
The middle arrow includes focusing and selecting. Ordinary successful
\texttt{tmux split-window} with a long-lived shell instead increments
both the pane count in the visible window and the live shell endpoint count.
Consequently a translation sending these two split commands directly to one
another cannot preserve the endpoint count after each command. A common
operational signature can express both by giving layout refinement, endpoint
allocation, and assignment of an endpoint to a visible slot separate effects.
A composite implementing a command may make its intermediate states private.
In particular, the unbound slot after a Screen split is externally observable,
whereas privately allocating a slot while implementing an atomic command
introduces no such observation.
\subsection{Client focus and session resurrection in Zellij}
Initialize two writable clients on pane $p$ of a tab with two terminal panes
$p,q$, disable synchronized input, and leave both panes in ordinary input
mode. Let client $a$ move its focus to $q$, then have client $b$ type a
distinguishable character. With Zellij's independent client cursors,
$b$ can stay on $p$. With session mirroring enabled, changing the common
focus to $q$ directs the character to $q$. The observation is the recipient
of the character, so identical terminal contents before the input do not
collapse the test~\cite{zellij}. Abstractly, for a fixed tab and $n$
clients, the independent focus configurations lie in $P^n$, where $P$ is
its set of focusable panes. A shared focus lies in the diagonal
$\Delta P\subseteq P^n$. For $p\ne q$, moving just the first coordinate
takes $(p,p)$ to $(q,p)$ outside that diagonal. This gives an explicit
obstruction to identifying the two policies while preserving both clients'
input routes.
Zellij also distinguishes attachment to a live session from resurrection
after the session exits. Its serialized layout records panes, tabs, and
commands. Viewport and scrollback recording are configurable. Under the
documented default, a resurrected command awaits confirmation before a
fresh invocation~\cite{zellij}. To see why even recording the viewport
cannot give general process continuation, let a program read a bit with
terminal echo disabled, retain it in memory, clear its display, and wait
for a query. The two choices of bit yield identical layout, command, and
visible text, yet the program would answer the next query differently.
The choice can be made without ever writing the bit to scrollback.
Any reconstruction determined by that saved record gives the same
reconstructed state in both cases and cannot reproduce both answers.
An application-specific resume command can recover further state when the
application has recorded it elsewhere.
\subsection{Attachment without a saved display in dtach}
The single-program relay dtach admits multiple attachments, forwards
application output to attached terminals, and maintains no terminal
emulation grid. An attaching client can request a redraw, including
by signalling the application, or can disable that request~\cite{dtach}.
Start one client, emit a marker and let the client receive it, then detach.
Attach a fresh terminal with redraw disabled while the application is
silent. Its live computation survives. The relay has no stored grid from
which to reconstruct the old marker for that new terminal. This order
of events excludes unread output waiting to be forwarded.
The example separates two specifications that applications often conflate.
One speaks about continuity of a computation across changes of client.
The other specifies what image a newly attached client can obtain before
further application output. The first is meaningful for a raw relay.
The second requires a source for that image, such as a retained emulator
state or a redraw produced by the application. A comparison that forgets
rendering can identify the same live attachment trace in these systems.
Enriching the observation with the fresh client's initial image distinguishes
them again.
\section{What can be reconstructed from several views?}
\label{sec:mux-descent}
Consider two observers of a linked window. One reads through a narrow viewport, the other through a wide one. Screen column 7 can refer to different pane cells on their two displays. Conversely, cells reached through different session names can refer to the same pane cell. To compare these observations one must specify a sampling epoch, a coordinate map, and what equality of readings means.
Fix a structural configuration for one epoch, including pane identities, their sizes, and the coordinate maps used for sampling. Let $X$ be a finite set of canonical addresses. A cell address may have the form $(p,i,j)$ for a pane $p$, row $i$ and column $j$. An address for metadata may instead have the form $(w,p,\mathrm{active})$. To observe a client-specific focus, include the client identifier in the address. For each $x\in X$ fix a set $A_x$ of values. For instance, a text-only observation can use a glyph string together with a continuation marker for a wide cell. A style-sensitive observation also records attributes. Equality throughout is equality in the specified $A_x$.
A client chart consists of local sample positions $D$, a map $q:D\to X$, and values $y(d)\in A_{q(d)}$. An observation in this model supplies $q$ separately, for example from a layout and viewport offset. If $q$ has repeated values, the chart descends to $q(D)$ exactly when $y$ is constant on each fibre. Several charts reduce in this way to subsets of $X$. Client overlays require client-indexed addresses when they matter. If a renderer discards an attribute, equality can be tested on a chosen common quotient of the values by applying the quotient map everywhere. A raw screenshot alone need not identify these coordinates or recover a hidden attribute.
\subsection{Gluing readings and realizing a server snapshot}
Use the site of subsets of $X$, with inclusions as arrows and jointly covering unions as covers. The presheaf
\[
E(U)=\prod_{x\in U} A_x
\]
restricts by forgetting coordinates. To see that it is a sheaf, choose the value at each $x$ from any chart containing it. Agreement gives independence of this choice and the cover gives uniqueness. Equivalently, $E$ is an object of the topos of sheaves on a finite discrete space, which is equivalent to the category of $X$-indexed families of sets. This is the ordinary matching-family condition~\cite{stackssheaf}.
Let $B\ne\varnothing$ be a specified set of admissible snapshots in the fixed configuration, and let $o:B\to E(X)$ be the observation function. Write $R=o(B)$ and $R_U=\pi_U R$. The image presheaf $U\mapsto R_U$ is separated, since restrictions of any two different vectors disagree somewhere on a cover. Its sections remember which coordinate combinations a single snapshot can exhibit.
\begin{proposition}[Realizability on a cover]
For a cover $U=\bigcup_i U_i$, every compatible family of individually realizable readings is jointly realizable on $U$ if and only if
\begin{equation}
R_U=\{v\in E(U)\mid v|_{U_i}\in R_{U_i}
\text{ for every }i\}.
\label{eq:mux-join}
\end{equation}
On the site of all subsets, the image presheaf is a sheaf if and only if $R=\prod_{x\in X}R_{\{x\}}$, using the canonical identification of singleton vectors with their values.
\end{proposition}
\begin{proof}
The ambient sheaf identifies compatible local families bijectively with the vectors on the right of~\eqref{eq:mux-join}. Such a vector has a witness $b\in B$ precisely when it belongs to $R_U$. Applying the criterion to the singleton cover of $X$ proves necessity of the product condition. Conversely, if $R$ is the product, every partial vector with allowed coordinates extends by filling the remaining coordinates from any fixed element of $R$. This gives the criterion on every cover. The observation vector is unique when it exists, while its witness in $B$ may have arbitrary multiplicity.
\end{proof}
Equation~\eqref{eq:mux-join} is the lossless-join criterion for these projections, written as descent~\cite{muxjoins}. The associated sheaf of the image presheaf allows every combination of individually attainable values because a singleton cover forces exactly those gluings. Thus sheafifying a display model can erase a server invariant.
\paragraph{A focus obstruction with an observed overlap.}
Take a single ordinary tmux window with three selectable tiled panes $p,q,r$, recording the window's active-pane flag. Query the same window-level notion in all charts. Restrict attention to this field and allow each of the three selections. In the order $(p,q,r)$ the observation relation is
\[
R=\{(1,0,0),(0,1,0),(0,0,1)\}.
\]
The chart $\{p,r\}$ can observe $(1,0)$ by selecting $p$. The chart $\{q,r\}$ can observe $(1,0)$ by selecting $q$. Both report $r=0$. Their unique ambient amalgamation $(1,1,0)$ violates the one-active-pane invariant. Likewise, each proper chart can report an all-zero vector when the selected pane is outside it. For charts covering the window, a compatible family is globally realizable precisely when its union has exactly one positive flag. If the unique positive flag identifies $p$, selecting $p$ gives a witness. This obstruction applies to simultaneous observations of a common selector. Different timestamps or client-specific selectors describe a different reconstruction problem.
\subsection{Transporting pane names across anonymous views}
A stronger observer may record how local names correspond instead of assuming persistent server identifiers. Consider an auxiliary observation graph $K$. A vertex represents a view with $n$ distinguishable slots, and an edge represents a proposed bijection of slots across two views. This model applies to comparisons for which such a bijection is part of the data. It can be used, for example, by a recorder that has discarded pane IDs. In a comparison of subsets one first restricts the charts to the common tracked slots.
Fix $G=S_n$ and one orientation per edge. On a subgraph $H$ define a groupoid $\mathcal{T}(H)$. An object assigns $t_e\in G$ to every edge, with $t_{\bar e}=t_e^{-1}$ on reversal. An arrow $t\to t'$ consists of a change $h_v\in G$ at each vertex such that, for $e:v\to w$,
\[
t'_e=h_w t_e h_v^{-1}.
\]
These are the functors from the free path groupoid of $H$ to the one-object groupoid $BG$, with natural isomorphisms. Use the site of subgraphs with union covers, so an edge belongs to a chart together with both its endpoints.
\begin{proposition}[Descent of name transports]
Restriction from $\mathcal{T}(H)$ to coherent descent data on any subgraph cover of $H$ is an equivalence of groupoids. On a connected nonempty $H$, a transport is isomorphic to the constant identity transport if and only if every closed path has identity product.
\end{proposition}
\begin{proof}
An arrow on $H$ is determined by its vertex elements. Compatible local arrows glue vertex by vertex, and their edge equations hold wherever the corresponding edge is covered. For objects, suppose charts $H_i$ carry transports $t^i$ and overlap isomorphisms $h^{ij}:t^i\to t^j$ obeying $h^{jk}h^{ij}=h^{ik}$. For each vertex $v$, choose a chart $i(v)$ containing it. On a chart $i$ use the gauge $h^{i,i(v)}_v$ at $v$. The transformed labels agree for each edge in two charts by the edge equations and the vertex cocycle. They define a global transport and the chosen gauges exhibit the required isomorphism to its restrictions. Finally label a spanning tree starting at a root, propagating an initial frame by edge products. Each remaining edge respects the propagated frames exactly when its associated fundamental cycle has identity product. A global change of frames conjugates the product around any loop, which proves the converse.
\end{proof}
For three views arranged in a triangle with two tracked slots, label two edges by the identity and the third by a transposition. This defines a global transport whose loop exchanges the two names. On each edge separately the change is removable by choosing endpoint frames. A global consistent numbering exists precisely when the loop product is identity. The obstruction concerns the additional choice of numbering. Descent of the transports themselves still holds, and retains the overlap isomorphisms that a set of local isomorphism classes would discard~\cite{stacksstack}. If every chart was produced from the same stable pane IDs and every correspondence used those IDs, every loop product would be identity. A nonidentity loop can therefore expose inconsistent proposed correspondences in a recorder.
\section{Behavioral equivalence and the recovery of sharing}
\label{sec:refinement}
A migration tool may reconstruct two identical terminal images and still change what the user can do. Consider a session handle in each of two sessions. In the first configuration the handles address the same one-pane window. In the second they address separate windows occupied by identical copies of a test application. The two app instances can start with identical cell contents. A subsequent edit through one handle can nevertheless distinguish the configurations. This distinction depends on the operations available to the observer.
\subsection{Comparing through a common interface}
Fix an action alphabet $A$ and an observation set $O$. An adapter maps abstract handles to implementation-specific targets and translates actions into commands, bytes, or controlled environment steps. Its observation map might return pane contents stripped of borders and status lines. It might instead expose raw control-mode events. These choices define different comparisons. For the following result an adapter exposes a set $X$ of observation-boundary states, a map $o:X\to O$, and a partial deterministic transition $d:X\times A\rightharpoonup X$. Every trial must reach a chosen observation boundary or return a recognizable refusal in finite time. Any scheduler, process input, and asynchronous delivery decisions needed for determinacy are fixed or supplied as actions. Terminal application exit can be recorded as a distinguished observation in $O$. Timing and internal divergence fall outside this experiment. Where retries after errors matter, the adapter can return an error observation together with an ordinary successor.
For a test that stops at the first refusal, adjoin one absorbing state $\bot$ to $X$, send undefined transitions to it, and give it the fresh observation $\mathsf{refused}$. Write $\bar d,\bar o$ for the resulting total maps. The behavior of $x$ is the function on finite action words
\[
b_x(w)=\bar o(\bar d^{*}(x,w))\quad (w\in A^{*}),
\]
where $\bar d^{*}$ iterates from left to right with $\bar d^{*}(x,\epsilon)=x$. Every intermediate observation occurs as the value at a prefix. This is the usual deterministic Moore coalgebra. Its behavior space consists of functions $A^{*}\to O\sqcup\{\mathsf{refused}\}$, with observation at $\epsilon$ and $a$-successor $f_a(w)=f(aw)$ \cite{rutten}.
\begin{proposition}[Finite experiments]
Two adapted states have the same behavior if and only if they belong to a relation $R$ on the two totalized state sets such that
\[
\begin{split}
(x,y)\in R\quad\Longrightarrow\quad&
\bar o_X(x)=\bar o_Y(y),\\[-2pt]
& (\bar d_X(x,a),\bar d_Y(y,a))\in R\quad(a\in A).
\end{split}
\]
\end{proposition}
\begin{proof}
If such an $R$ exists, induction on word length keeps the successor pair in $R$ and gives equality of observations. Conversely take all pairs satisfying $b_x=b_y$. The empty word gives equal present observations, and evaluation on $aw$ gives equality of the successor behaviors for every $a$. This also proves that behavior equality is the largest such relation.
\end{proof}
Relational composition preserves the displayed conditions because the intermediate state supplies a witness both before and after each action. Comparisons therefore compose when all adapters use the same interface and observation boundary. The result applies to finite adaptive tests because equal prefix observations make such a tester choose the same next action at each step. It proves an equivalence of observable behaviors. Transporting specified interchange cells in an execution model requires additional data about which pairs of actions may be interchanged.
\subsection{How many writes reveal an alias?}
Take $n\geq 1$ persistent, named handles in a quiescent test fixture. Each handle addresses exactly one backing terminal, giving an unknown partition $\pi$ of the handles. The fixture presents a designated marker cell from each handle. Initially all these cells are blank. A successful probe at handle $i$ writes a fresh marker through a cooperating application at its backing terminal and waits until the marker can be read. It changes exactly the marker cells of the handles addressing that terminal. Between probes the observer may read the entire vector of markers. Identity queries, broadcast input, and external writers are outside this interface. Handles in different sessions that refer to the same linked one-pane window supply one realization of the sharing pattern.
\begin{theorem}[Identifiability and worst-case cost]
Distinct sharing partitions give distinct behaviors at this interface. Identifying an arbitrary partition with certainty requires exactly $n-1$ single-handle writes in the worst case, with unrestricted marker reads.
\end{theorem}
\begin{proof}
The positions carrying the new marker after a write to $i$ form precisely its block $[i]_\pi$. Probe one unclassified handle, record the whole block, and remove it from consideration. When at most one handle remains its membership is determined. Each write classifies at least one handle, giving the upper bound and identifiability. For the lower bound, run an exact tester on the partition into singletons. If it stops after fewer than $n-1$ writes, there exist two handles it has never written. Merge just those two blocks. Every chosen write still changes precisely its original cell, and all reads still agree. Induction over the observed transcript gives the same choices and the same answer for both partitions. They require different answers. The case $n=1$ uses zero writes.
\end{proof}
For two handles the separating word consists of a single write, observed through the second handle. Raw pane IDs, if exposed, can reveal sharing with zero writes. Conversely, two applications that intentionally replicate the marker can mimic a shared terminal. The theorem recovers an alias partition from its stipulated intervention law. A real diagnostic must establish that law for its fixture before interpreting the result as evidence about process or terminal identity.
\section{Experiments and reproducibility}
\label{sec:evidence}
We tested a live tmux server, the kernel interface to a pseudoterminal, and a finite marker machine whose alias relation is known to the checker. Each boundary exposes different evidence for the preceding results.
\subsection{A live server with two sessions and three clients}
We exercised an unmodified Debian tmux 3.5a-3 executable in an x86-64 Linux 6.12.115-0-virt guest with Python 3.13.5. The test starts a private server with an empty configuration, opens two sessions, and attaches two control clients to \texttt{alpha} and one to \texttt{beta}. A shell with terminal echo disabled prints a response for each completed input line. This makes seeing a marker evidence of the workload processing the line. Each observation uses a tmux command with an explicit target where applicable. Two fresh guest boots completed all assertions. Their records agreed except for the operating system-assigned PID (434 and 435). Table~\ref{tab:run} gives the recorded values from one run. IDs in subsequent installations can differ.
\begin{table}[htbp]
\caption{Observed tmux transitions. Window and pane IDs carry tmux's literal prefixes. A capture reads the server's stored pane contents.}
\label{tab:run}\centering\small
\renewcommand{\arraystretch}{1.17}
\begin{tabularx}{\linewidth}{@{}p{.25\linewidth}>{\raggedright\arraybackslash}X@{}}
\toprule
Operation or condition & Observation\\
\midrule
Link \texttt{alpha:0} at \texttt{beta:7} & Distinct sessions \texttt{\$0} and \texttt{\$1} gave the same window \texttt{@0}, pane \texttt{\%0}, and initial pane PID 435.\\
Select \texttt{alpha:1} & The clients' window IDs changed from $(\texttt{@0},\texttt{@0},\texttt{@2})$ to $(\texttt{@1},\texttt{@1},\texttt{@2})$.\\
Send \texttt{one} via \texttt{beta:7} & Captures via both links contained the single application response \texttt{PROCESSED one}.\\
Detach all three, release gate & Attached-client lists were empty before and after the producer wrote \texttt{OUTPUT-WHILE-DETACHED}. Reattachment preserved the pane ID, pane PID, and captured lines across that step.\\
Unlink \texttt{beta:7} & The other three indexed links remained. Sending a new line through \texttt{alpha:0} produced \texttt{PROCESSED two}.\\
\bottomrule
\end{tabularx}
\end{table}
The gate matters. The producer first printed \texttt{ARMED} and then waited for a filesystem marker. The harness waited for all persistent control clients to exit before creating that marker. Short-lived administrative clients queried the server. This ordering shows that new output was processed during the detached interval. An unchanged capture would provide weaker evidence. The result establishes continuity for the observed interval under the tested configuration. It cannot tell us what a server configured to terminate on its last detach would do.
The same fixture also tests an independence prediction. Reset the names of windows at \texttt{alpha:0} and \texttt{beta:0} to \texttt{initial}. Preparing one rename to \texttt{left} and one to \texttt{right}, run the two possible orders, resetting names before each trial. With targets \texttt{alpha:0} and \texttt{beta:0}, both orders ended at $(\texttt{left},\texttt{right})$. With targets \texttt{alpha:0} and \texttt{beta:7}, the orders ended at $(\texttt{right},\texttt{initial})$ and $(\texttt{left},\texttt{initial})$. Distinct textual targets were insufficient to infer commutation. The observation here is the final pair of window names. Counting all ordered rename notifications could distinguish even the first two executions.
\paragraph{Two further predictions.}
A second fixture exposed one pane as \texttt{count:0} and \texttt{beta:8}. Sending the same literal line once per resolved pane produced one \texttt{PROCESSED repeat} response. Traversing both handles and sending once per handle produced two responses. Ordered end markers delimited the trials, and terminal echo was disabled. This is a live witness to the failure of idempotence for literal input in Theorem~\ref{thm:alias}.
For the focus example, we selected each of three ordinary tiled panes and queried the three window-level active flags in a fixed pane order. The three resulting rows were $100,010,001$. Restricting the first to $\{p,r\}$ and the second to $\{q,r\}$ produced $(1,0)$ twice. Their common cell value at $r$ admits an ambient gluing $110$, which violates unique focus. The restrictions were sampled from two different selections on purpose. The calculation asks whether their values could have come from a single selection.
\subsection{PTY effects and finite enumeration}
A separate Linux test used kernel 6.18.57 and Python 3.12.14. With canonical mode enabled and echo disabled, writing \texttt{abc} to a PTY master left a nonblocking slave read at \texttt{EAGAIN}. Adding a newline made the line \texttt{abc} followed by that newline available. For the resize test, a foreground child on a controlling PTY blocked and waited for \texttt{SIGWINCH}. Changing the geometry from $(0,0)$ to $(37,101)$ delivered the signal, and the child read back 37 rows and 101 columns. The two independent probes support the placement of buffering and size feedback in Section~\ref{sec:operational}.
The finite enumeration fixes the marker model of Section~\ref{sec:refinement}. For each partition on a labelled set it repeatedly probes the least unclassified handle until at most one remains. For $n=1,\ldots,8$ the counts of partitions recovered were $1,2,5,15,52,203,877,4140$, a total of 5,295 instances. The maximum number of writes for each $n$ was $n-1$. On the singleton execution, merging each possible pair still untouched at each eligible prefix produced 210 comparisons with identical observed prefixes. The enumeration checks one concrete algorithm. The lower bound for arbitrary exact adaptive testers follows from the indistinguishability proof.
The source bundle contains the full manuscript, a journal-length text, and three Python scripts with their recorded JSON results. The tmux probe takes an optional executable path. Its README lists the Unix prerequisites. The PTY probe requires a Linux environment with a controlling PTY facility. The partition enumeration uses only the Python standard library.
\section{Conclusion}
A terminal multiplexer can preserve one computation while exposing it through several names, views, and command contexts. For a controller, the kernel pair of the address map says which visits can repeat a side effect. For a scheduler, the same identification says which apparently distinct commands may compete for one resource. For an observer who lacks object IDs, the marker experiment shows exactly how many interventions can reveal the hidden sharing under an explicit application contract. These three uses of the same partition connect the structure of tmux's window links to an operational test.
A full interoperability claim must also choose its observations. Agreement of sampled cells has a gluing law. Realizability by one server additionally enforces constraints such as unique focus. Process continuation requires information that a display snapshot may omit altogether. The Screen split, Zellij mirror and resurrection policies, and dtach reattachment each distinguish a different one of these obligations. A follow-up mechanization can start with the finite store and ideal construction, the image relation for focus, and the marker-machine lower bound, each of which has explicit inputs and a proof independent of the Unix runtime.
\paragraph{Authorship and automation.}
Prepared anonymously for consideration by \emph{Higher Categorical Semantics}. An AI assistant developed the exposition and mathematical arguments, wrote the probes, and used automated tools to execute and inspect them. The cited manuals document implementation contracts. The supplied scripts and recorded outputs identify the empirical checks. The arguments are provided as written proofs.
\begin{thebibliography}{99}
\bibitem{tmux} N. Marriott and tmux contributors. \emph{tmux(1)}, Debian package 3.5a-3. See Clients and Sessions, Windows and Panes, Options, and Control Mode. \href{https://manpages.debian.org/trixie/tmux/tmux.1.en.html}{Debian manual}.
\bibitem{control} tmux project. \emph{Control Mode}. \href{https://github.com/tmux/tmux/wiki/Control-Mode}{Project documentation}.
\bibitem{pty} Linux man-pages project. \emph{pty(7): pseudoterminal interfaces}. \href{https://man7.org/linux/man-pages/man7/pty.7.html}{Linux manual}.
\bibitem{winsz} Linux man-pages project. \emph{TIOCGWINSZ, TIOCSWINSZ: get and set window size}. \href{https://man7.org/linux/man-pages/man2/TIOCSWINSZ.2const.html}{Linux manual}.
\bibitem{ecma} Ecma International. \emph{ECMA-48: Control Functions for Coded Character Sets}. Fifth edition, 1991. \href{https://ecma-international.org/publications-and-standards/standards/ecma-48/}{Standard}.
\bibitem{xterm} T. E. Dickey and contributors. \emph{XTerm Control Sequences}. See control-byte processing and ED. \href{https://invisible-island.net/xterm/ctlseqs/ctlseqs.html}{Reference}.
\bibitem{screen} GNU Project. \emph{Screen User's Manual}, especially Selecting a Window and Regions. \href{https://www.gnu.org/software/screen/manual/screen.html}{Manual}.
\bibitem{zellij} Zellij project. \emph{Zellij User Guide} and project notes. \href{https://zellij.dev/documentation/options.html}{Options}, \href{https://zellij.dev/news/multiplayer-sessions/}{multiple cursors}, and \href{https://zellij.dev/documentation/session-resurrection.html}{session resurrection}.
\bibitem{dtach} N. Crigler. \emph{dtach}, project README and manual. \href{https://github.com/crigler/dtach}{Source and documentation}.
\bibitem{mosh} K. Winstein and H. Balakrishnan. Mosh: an interactive remote shell for mobile clients. \emph{USENIX Annual Technical Conference}, 2012. \href{https://www.usenix.org/conference/atc12/technical-sessions/presentation/winstein}{Proceedings}.
\bibitem{benabou} J. B\'enabou. Introduction to bicategories. \emph{Reports of the Midwest Category Seminar}, Lecture Notes in Mathematics 47, 1--77, 1967. \href{https://doi.org/10.1007/BFb0074299}{doi:10.1007/BFb0074299}.
\bibitem{trace} V. Diekert and A. Muscholl. Trace theory. In D. Padua (ed.), \emph{Encyclopedia of Parallel Computing}, 2071--2079, 2011. \href{https://doi.org/10.1007/978-0-387-09766-4_491}{doi:10.1007/978-0-387-09766-4\_491}.
\bibitem{goubault} \'E. Goubault. Some geometric perspectives in concurrency theory. \emph{Homology, Homotopy and Applications} 5(2), 95--136, 2003. \href{https://intlpress.com/site/pub/files/_fulltext/journals/hha/2003/0005/0002/HHA-2003-0005-0002-a005.pdf}{Journal article}.
\bibitem{stackssheaf} The Stacks Project Authors. \emph{Sites and Sheaves}, Definition 7.7.1. \href{https://stacks.math.columbia.edu/tag/00VM}{Tag 00VM}.
\bibitem{stacksstack} The Stacks Project Authors. \emph{Stacks}, Definition 8.4.1. \href{https://stacks.math.columbia.edu/tag/026F}{Tag 026F}.
\bibitem{muxjoins} C. Beeri, R. Fagin, D. Maier, A. Mendelzon, J. Ullman and M. Yannakakis. Properties of acyclic database schemes. \emph{Proceedings of STOC}, 355--362, 1981. \href{https://research.ibm.com/publications/properties-of-acyclic-database-schemes}{Research record}.
\bibitem{rutten} J. J. M. M. Rutten. Universal coalgebra: a theory of systems. \emph{Theoretical Computer Science} 249, 3--80, 2000. \href{https://ir.cwi.nl/pub/48/}{CWI publication record}.
\end{thebibliography}
\end{document}