# libtmux:rename-window

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

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

Rename the selected physical WINDOW and return a COMMAND-OUTCOME.
TEXT is literal by default; FORMAT-P explicitly enables tmux format expansion.
Tmux may normalize or reject names. OBSERVE acquires a replacement in
OUTCOME-VALUE; a failed follow-up stays in OUTCOME-OBSERVATION-ERROR without
erasing successful mutation. Earlier observations are unchanged. Signals
STALE-TARGET or an operational condition. Never retries the mutation.

## Parameters

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

## tmux command

The tmux commands behind `rename-window`.

- [`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-window`.

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