# Getting started

Source: https://libtmux.org/en/ruby/latest/guides/getting-started/

> Install tmux, pick a port, and run the smallest thing that proves your setup works.

## Install tmux

The common tmux baseline documented here is 3.2a. Individual features can
require a newer release; check your port's compatibility notes. Confirm your
installed version:

```console
$ tmux -V
```

If `tmux` is missing or older than 3.2a, install a supported version with your
platform's package manager. libtmux uses an installed tmux executable.

## Pick a port

Choose the port for your project's language: [Python](/py/), [TypeScript](/ts/),
[Rust](/rs/), [Go](/go/), [Java and Kotlin](/java/), [.NET](/dotnet/),
[C++](/cxx/), or [Swift](/swift/). [Server, session, window,
pane](/concepts/server-session-window-pane/) explains the shared model, and
[Control mode vs one-shot](/concepts/transports/) covers transport differences.

For a prerelease package, pin an exact version and check its release notes
before upgrading. API availability and defaults can differ between ports.

## Run the smallest thing that proves it works

Start a tmux session to connect to: in one terminal:

```console
$ tmux new-session -s foo -n bar
```

In a second terminal, install your port's package and run its example. The
Python example uses the `foo` session above; the other examples create their own
sessions. Installation commands appear in comments at the start of each block.
[Attach and send keys](/examples/attach-and-send-keys/) provides the full
examples, their source files, and their validation details.

## What just happened

A server handle targets tmux without taking over your terminal. Creating a
session starts the server if needed. Sending keys writes input to a pane; the
method's Enter and literal-text options control how tmux interprets it. [Sending
keys](../sending-keys/) explains those defaults. Capture methods read the pane's
screen or a requested scrollback range.

## Where to go next

- [Concepts](/concepts/) for the mental model behind what you just did:
  the object hierarchy, how commands actually reach tmux, and how filtering
  works once you have more than one session to choose from.
- [Attaching to tmux](../attaching-to-tmux/), [Sending keys](../sending-keys/),
  and [Capturing output](../capturing-output/) go one level deeper into each
  half of the round trip you just ran.
- [Attach and send keys](/examples/attach-and-send-keys/) for the fully
  checked version of every block above, and how each one is verified.
- Your port's own API reference (via the port switcher) once you're ready
  to look up method details.
