Typed tmux values for Haskell
Parse tmux entity IDs, validate dimensions and indices, and check stable tmux releases with pure Haskell functions.
Getting started
Install the source package and run the complete values example.
Typed values
Understand entity IDs, indices, dimensions and version admission.
API reference
Public modules, types, constructors and functions from Haddock.
Implementation status
Check public capabilities, compatibility evidence and package boundaries.
Install
packages: .
source-repository-package type: git location: https://github.com/libtmux/libtmux-haskell tag: "581f0ee45016ffb2283366bb1edc1658df26c5ed"Save as cabal.project and add libtmux-haskell ^>=0.1.0.0 to your component's build-depends. Requires Linux x86_64, GHC 9.14.1 and Cabal 3.18.2.0. The core package is available from source; it is not published on Hackage.
At a glance
| Module | Provides |
|---|---|
LibTmux.Id | Distinct session, physical-window and physical-pane IDs. |
LibTmux.Value | Positive dimensions and nonnegative contextual indices. |
LibTmux.Version | Parse stable tmux releases and check the supported release range. |
What it does
{-# LANGUAGE OverloadedStrings #-}
-- | Construct tmux domain values without starting a process-- or contacting a server.module Main (main) where
import LibTmux.Id (parseWindowId, renderWindowId)import LibTmux.Value (dimensionValue, mkDimension)import LibTmux.Version (parseVersion, renderVersion, requireSupported)
main :: IO ()main = do version <- either (fail . show) pure $ parseVersion "tmux 3.3a\n" >>= requireSupported window <- either (fail . show) pure (parseWindowId "@17") width <- either (fail . show) pure (mkDimension 120) print (renderVersion version, renderWindowId window, dimensionValue width)Run this example
Linux x86_64, GHC 9.14.1, Cabal 3.18.2.0, Git, a C11 compiler, and network access to GitHub and Hackage for source dependencies. No running tmux server is required.
Save the program above as Main.hs in a new directory, along with the files below.
This program validates supplied values and prints the result. It does not start tmux or create resources requiring cleanup.
libtmux-typed-values.cabal
cabal-version: 3.18name: libtmux-typed-valuesversion: 0.0.0build-type: Simplelicense: MIT
executable typed-values main-is: Main.hs default-language: GHC2024 ghc-options: -Wall -Werror build-depends: base >=4.22 && <4.23, libtmux-haskell ^>=0.1.0.0cabal.project
packages: .index-state: 2026-11-06T00:00:00Z
source-repository-package type: git location: https://github.com/libtmux/libtmux-haskell tag: 581f0ee45016ffb2283366bb1edc1658df26c5edSetup and run
cabal updatecabal run --verbose=0 typed-valuesExpected output
("3.3a","@17",120)Client, capture and mutation APIs are under development. The workspace library and CLI are planned as a separate package using the core. MCP is excluded from this port. Read the implementation status before choosing the package for automation.