# lock-command

Source: https://libtmux.org/en/tmux/latest/catalog/options/lock-command/

> Command to run when locking each client.

option tmux3.7c

Command to run when locking each client.

* Scope

  session

* Type

  Text

* Default

  `lock -np`

* Set

  [`set-option`](https://libtmux.org/en/tmux/latest/manual/set-option/) `lock-command value`

* Read

  [`show-options`](https://libtmux.org/en/tmux/latest/manual/show-options/) `lock-command`

## Description[#](https://libtmux.org/en/tmux/latest/catalog/options/lock-command/#description)

Command to run when locking each client. The default is to run [lock(1)]() with `-np`.

## Releases[#](https://libtmux.org/en/tmux/latest/catalog/options/lock-command/#releases)

* [tmux 3.7c](https://libtmux.org/en/tmux/3.7c/catalog/options/lock-command/) : present
* [tmux 3.2a](https://libtmux.org/en/tmux/3.2a/catalog/options/lock-command/) : present

## Source[#](https://libtmux.org/en/tmux/latest/catalog/options/lock-command/#source)

* Defined in

  [`options-table.c:719`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/options-table.c#L719)

* C source reference

  [`options_table`](https://libtmux.org/en/tmux/latest/reference/c-variable-options_table/)

* CLI Manual

  [Original manual entry](https://libtmux.org/en/tmux/latest/manual/full/#options-lock-command)

## Used by[#](https://libtmux.org/en/tmux/latest/catalog/options/lock-command/#used-by)

Library documentation that names this option.

* Rust

  [`client.Client.lock`](https://libtmux.org/en/rs/latest/reference/client-client-lock/), [`error.Error.ClientSuspended`](https://libtmux.org/en/rs/latest/reference/error-error-clientsuspended/), [`options.generated.LOCK_COMMAND`](https://libtmux.org/en/rs/latest/reference/options-generated-lock_command/), [`server.Server.lock_all`](https://libtmux.org/en/rs/latest/reference/server-server-lock_all/), [`session.Session.lock`](https://libtmux.org/en/rs/latest/reference/session-session-lock/)

* Go

  [`tmux.GlobalSessionScope.SetLockCommand`](https://libtmux.org/en/go/latest/reference/tmux-globalsessionscope-setlockcommand/), [`tmux.Session.SetLockCommand`](https://libtmux.org/en/go/latest/reference/tmux-session-setlockcommand/), [`tmux.SessionOptionValues.LockCommand`](https://libtmux.org/en/go/latest/reference/tmux-sessionoptionvalues-lockcommand/)
