# LibTmux.Creation

- **Package:** libtmux-haskell
- **Language:** Haskell
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-haskell/blob/72edb54317bf619c6dc54bff311844f062f8984c/src/LibTmux/Creation.hs
- **Page:** https://libtmux.org/en/haskell/latest/reference/libtmux-creation/

Checked creation options, explicit link context and historical identities.

[`LibTmux.Server`](/en/haskell/latest/reference/libtmux-server/) executes creation in IO through an existing pinned handle.
 Start from [`defaultSessionOptions`](/en/haskell/latest/reference/libtmux-creation-v-defaultsessionoptions/), [`defaultWindowOptions`](/en/haskell/latest/reference/libtmux-creation-v-defaultwindowoptions/) or
 [`defaultSplitOptions`](/en/haskell/latest/reference/libtmux-creation-v-defaultsplitoptions/); option fields perform no IO.

A [`CreatedEntities`](/en/haskell/latest/reference/libtmux-creation-t-createdentities/) contains the actual references printed by tmux before
 after-hooks. It remains usable after the Server closes, but proves neither
 current liveness nor successful process exec. Acquire a fresh snapshot and
 use [`LibTmux.Snapshot`](/en/haskell/latest/reference/libtmux-snapshot/) to observe those identities again.

## Members

### Common operations

- [`WindowSlot`](/en/haskell/latest/reference/libtmux-creation-t-windowslot/) (data type): An exact session/index position. The occupant can change after capture.
 Indices used by native commands must fit tmux's signed 32-bit domain.
- [`CreatedEntities`](/en/haskell/latest/reference/libtmux-creation-t-createdentities/) (data type): Historical identities printed during session, window or pane creation. A later hook
 may already have removed them. Resolve through a fresh captured snapshot;
 these references do not constitute hydrated observations or prove liveness.
 Read these fields with record dot; construction remains private.
- [`CreatedPane`](/en/haskell/latest/reference/libtmux-creation-t-createdpane/) (typealias): A :obj:`CreatedEntities <LibTmux.Creation#t:CreatedEntities>` receipt from split-window: the pane is new; its session,
 physical window and link index record the exact execution context.
- [`CreatedSession`](/en/haskell/latest/reference/libtmux-creation-t-createdsession/) (typealias): A :obj:`CreatedEntities <LibTmux.Creation#t:CreatedEntities>` receipt from new-session: all three entities are new.
- [`CreatedWindow`](/en/haskell/latest/reference/libtmux-creation-t-createdwindow/) (typealias): A :obj:`CreatedEntities <LibTmux.Creation#t:CreatedEntities>` receipt from new-window: the window and pane are new;
 the session and link index identify where tmux created them.
- [`defaultSessionOptions`](/en/haskell/latest/reference/libtmux-creation-v-defaultsessionoptions/) (function): Detached creation with generated names, native geometry/environment and
 :obj:`DefaultProcess <LibTmux.Creation#v:DefaultProcess>`. Creation captures the calling client's OS context in IO.
- [`defaultSplitOptions`](/en/haskell/latest/reference/libtmux-creation-v-defaultsplitoptions/) (function): Split below the exact anchor without selection, full-window or zoom
 requests. Use tmux's size and launch defaults.
- [`defaultWindowOptions`](/en/haskell/latest/reference/libtmux-creation-v-defaultwindowoptions/) (function): Generated name, native geometry*cwd*environment, no selection request,
 :obj:`RefuseOccupied <LibTmux.Creation#v:RefuseOccupied>` and :obj:`DefaultProcess <LibTmux.Creation#v:DefaultProcess>`.
- [`InitialProcess`](/en/haskell/latest/reference/libtmux-creation-t-initialprocess/) (data type): Initial pane process, retaining tmux's distinct execution modes.
 A native argv needs at least one argument after the executable because tmux
 treats a single entry as shell input. :obj:`DirectCommand <LibTmux.Creation#v:DirectCommand>` encodes that condition.
- [`SplitOptions`](/en/haskell/latest/reference/libtmux-creation-t-splitoptions/) (data type): Split one exact pane through an explicit :obj:`WindowSlot <LibTmux.Creation#t:WindowSlot>`. The pane must occupy
 that slot's physical window when tmux executes the request. No active-pane
 lookup, reuse or replacement occurs. Launch fields follow :obj:`WindowOptions <LibTmux.Creation#t:WindowOptions>`.
- [`WindowOptions`](/en/haskell/latest/reference/libtmux-creation-t-windowoptions/) (data type): Window creation through an explicit placement. Names and cwd stay literal;
 environment and process bytes keep tmux's native interpretation. Geometry
 comes from the target session. tmux may normalize or reject the name.
 Options carry no Show instance because launch data can contain credentials.
- [`WindowPlacement`](/en/haskell/latest/reference/libtmux-creation-t-windowplacement/) (data type): A session's next free index, an exact slot, or insertion beside a slot.
 Relative insertion can shift existing indices before later creation fails;
 failure does not promise rollback. Grouped sessions can share these effects.
 If a relative slot is vacant, tmux creates at that index without insertion.
 :obj:`After <LibTmux.Creation#v:After>` refuses index 2147483647 before dispatch: no larger index exists.

### Other members

- [`defaultPaneMoveOptions`](/en/haskell/latest/reference/libtmux-creation-v-defaultpanemoveoptions/) (function): Place below the destination pane without requesting destination selection.
- [`PaneMoveOptions`](/en/haskell/latest/reference/libtmux-creation-t-panemoveoptions/) (data type): Placement of a relocated pane relative to the exact destination pane.
- [`PaneRelocationReceipt`](/en/haskell/latest/reference/libtmux-creation-t-panerelocationreceipt/) (data type): Historical evidence from the primary relocation command. Capture again
 to verify the requested slot and classify a break as window creation or
 transfer. A reported break link may be another link to the same window.
- [`SessionOptions`](/en/haskell/latest/reference/libtmux-creation-t-sessionoptions/) (data type): Checked when creation is requested. Nothing selects native defaults.
 Names and paths remain literal through tmux format parsing. Environment and
 shell/argv bytes retain their native interpretation. Options have no Show
 instance because command and environment data may contain credentials.
- [`SplitDirection`](/en/haskell/latest/reference/libtmux-creation-t-splitdirection/) (data type): Orientation of the two resulting panes. :obj:`before <LibTmux.Creation#v:SplitOptions.before>` chooses the left or top
 side for the new pane; otherwise it appears right or below the anchor.
- [`SplitSize`](/en/haskell/latest/reference/libtmux-creation-t-splitsize/) (data type): Requested extent of the new pane along the split direction. Cells must fit
 2147483647 and percentages must be between 1 and 100. tmux's border and layout
 constraints determine the actual size; a request can be clamped or refused.
- [`WindowCollision`](/en/haskell/latest/reference/libtmux-creation-t-windowcollision/) (data type): Occupied-slot policy for creation. Replacement removes the old link;
 other links can keep its physical window alive. Later failure can follow
 removal. Replacing the selected link can select the new window despite `-d`.

## Referenced by

- [`LibTmux`](/en/haskell/latest/reference/libtmux/) (module)

## Guides

Pages that discuss `LibTmux.Creation`.

- [Create sessions, windows and panes](/en/haskell/latest/guides/creation/)
- [Implementation status](/en/haskell/latest/guides/status/)
