# libtmux:rename-session

- **Package:** libtmux
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/operations.lisp#L22
- **Public owner:** libtmux
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-rename-session/

```
(rename-session client session text &key format-p (observe t) cancel-token timeout output-limit)
```

Rename SESSION with literal TEXT, or an explicit FORMAT-P expression.
Return a COMMAND-OUTCOME. OBSERVE defaults true and supplies a replacement
through OUTCOME-VALUE; observation failure is retained separately. Tmux enforces
session-name restrictions and uniqueness. Signals STALE-TARGET or an operational
condition. Timeout and byte limits cover preflight, mutation and observation.

## Parameters

- `client`
- `session`
- `text`
- `format-p?`
- `observe?`
- `cancel-token?`
- `timeout?`
- `output-limit?`

## tmux command

The tmux commands behind `rename-session`.

- [`rename-session`](/en/tmux/latest/manual/rename-session/)
- [`rename-window`](/en/tmux/latest/manual/rename-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_rename_session_entry`](/en/tmux/latest/reference/c-variable-cmd_rename_session_entry/) (attribute)
- [`cmd_rename_session_exec`](/en/tmux/latest/reference/c-function-cmd-rename-session-c-cmd_rename_session_exec/) (function)
- [`cmd_rename_window_entry`](/en/tmux/latest/reference/c-variable-cmd_rename_window_entry/) (attribute)
- [`cmd_rename_window_exec`](/en/tmux/latest/reference/c-function-cmd-rename-window-c-cmd_rename_window_exec/) (function)

## Guides

Pages that discuss `rename-session`.

- [Explicit operations](/en/lisp/latest/guides/operations/)
