# libtmux.Client

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** class
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/client.py#L28
- **Page:** https://libtmux.org/reference/py/libtmux-client/

:term:`tmux(1)` :term:`Client` [client_manual]_.

A tmux client is an attached terminal. The same tmux server can have
multiple clients attached simultaneously (e.g. ``$ tmux attach`` from
several terminals) and each receives its own view of the active
session, window, and pane.

## Example

```python
>>> with control_mode() as ctl:
...     attached = [
...         c
...         for c in server.clients
...         if c.client_name == ctl.client_name
...     ]
>>> bool(attached)
True
```

## Example

```python
>>> with control_mode() as ctl:
...     client = server.clients.get(client_name=ctl.client_name)
...     client.client_readonly in {"0", "1"}
True
```

## Members

- `server` (attribute)
- `refresh` (method) — Refresh client attributes from tmux.
- `from_client_name` (method) — Create Client from an existing client_name.
- `attached_session` (property) — Return the :class:`Session` this client is currently attached to.
- `attached_window` (property) — Return the :class:`Window` this client is currently viewing.
- `attached_pane` (property) — Return the :class:`Pane` this client is currently viewing.
- `_resolve_attached` (method) — Resolve live attachment with a single ``list-clients`` refresh.
- `active_window_index` (attribute)
- `alternate_saved_x` (attribute)
- `alternate_saved_y` (attribute)
- `bracket_paste_flag` (attribute)
- `buffer_name` (attribute)
- `buffer_sample` (attribute)
- `buffer_size` (attribute)
- `client_activity` (attribute)
- `client_cell_height` (attribute)
- `client_cell_width` (attribute)
- `client_control_mode` (attribute)
- `client_created` (attribute)
- `client_discarded` (attribute)
- `client_flags` (attribute)
- `client_height` (attribute)
- `client_key_table` (attribute)
- `client_last_session` (attribute)
- `client_mode_format` (attribute)
- `client_name` (attribute)
- `client_pid` (attribute)
- `client_prefix` (attribute)
- `client_readonly` (attribute)
- `client_session` (attribute)
- `client_termfeatures` (attribute)
- `client_termname` (attribute)
- `client_termtype` (attribute)
- `client_tty` (attribute)
- `client_uid` (attribute)
- `client_user` (attribute)
- `client_utf8` (attribute)
- `client_width` (attribute)
- `client_written` (attribute)
- `command_list_alias` (attribute)
- `command_list_name` (attribute)
- `command_list_usage` (attribute)
- `config_files` (attribute)
- `copy_cursor_line` (attribute)
- `copy_cursor_word` (attribute)
- `copy_cursor_x` (attribute)
- `copy_cursor_y` (attribute)
- `current_file` (attribute)
- `cursor_character` (attribute)
- `cursor_flag` (attribute)
- `cursor_x` (attribute)
- `cursor_y` (attribute)
- `history_bytes` (attribute)
- `history_limit` (attribute)
- `history_size` (attribute)
- `insert_flag` (attribute)
- `keypad_cursor_flag` (attribute)
- `keypad_flag` (attribute)
- `last_window_index` (attribute)
- `line` (attribute)
- `mouse_all_flag` (attribute)
- `mouse_any_flag` (attribute)
- `mouse_button_flag` (attribute)
- `mouse_sgr_flag` (attribute)
- `mouse_standard_flag` (attribute)
- `next_session_id` (attribute)
- `origin_flag` (attribute)
- `pane_active` (attribute)
- `pane_at_bottom` (attribute)
- `pane_at_left` (attribute)
- `pane_at_right` (attribute)
- `pane_at_top` (attribute)
- `pane_bg` (attribute)
- `pane_bottom` (attribute)
- `pane_current_command` (attribute)
- `pane_current_path` (attribute)
- `pane_dead` (attribute)
- `pane_dead_signal` (attribute)
- `pane_dead_status` (attribute)
- `pane_dead_time` (attribute)
- `pane_fg` (attribute)
- `pane_flags` (attribute)
- `pane_floating_flag` (attribute)
- `pane_format` (attribute)
- `pane_height` (attribute)
- `pane_id` (attribute)
- `pane_in_mode` (attribute)
- `pane_index` (attribute)
- `pane_input_off` (attribute)
- `pane_last` (attribute)
- `pane_left` (attribute)
- `pane_marked` (attribute)
- `pane_marked_set` (attribute)
- `pane_mode` (attribute)
- `pane_path` (attribute)
- `pane_pb_progress` (attribute)
- `pane_pb_state` (attribute)
- `pane_pid` (attribute)
- `pane_pipe` (attribute)
- `pane_pipe_pid` (attribute)
- `pane_right` (attribute)
- `pane_search_string` (attribute)
- `pane_start_command` (attribute)
- `pane_start_path` (attribute)
- `pane_synchronized` (attribute)
- `pane_tabs` (attribute)
- `pane_title` (attribute)
- `pane_top` (attribute)
- `pane_tty` (attribute)
- `pane_width` (attribute)
- `pane_x` (attribute)
- `pane_y` (attribute)
- `pane_z` (attribute)
- `pane_zoomed_flag` (attribute)
- `pid` (attribute)
- `scroll_position` (attribute)
- `scroll_region_lower` (attribute)
- `scroll_region_upper` (attribute)
- `search_match` (attribute)
- `selection_end_x` (attribute)
- `selection_end_y` (attribute)
- `selection_start_x` (attribute)
- `selection_start_y` (attribute)
- `session_activity` (attribute)
- `session_alerts` (attribute)
- `session_attached` (attribute)
- `session_attached_list` (attribute)
- `session_created` (attribute)
- `session_format` (attribute)
- `session_group` (attribute)
- `session_group_attached` (attribute)
- `session_group_attached_list` (attribute)
- `session_group_list` (attribute)
- `session_group_many_attached` (attribute)
- `session_group_size` (attribute)
- `session_grouped` (attribute)
- `session_id` (attribute)
- `session_last_attached` (attribute)
- `session_many_attached` (attribute)
- `session_marked` (attribute)
- `session_name` (attribute)
- `session_path` (attribute)
- `session_stack` (attribute)
- `session_windows` (attribute)
- `socket_path` (attribute)
- `start_time` (attribute)
- `synchronized_output_flag` (attribute)
- `uid` (attribute)
- `user` (attribute)
- `version` (attribute)
- `window_active` (attribute)
- `window_active_clients` (attribute)
- `window_active_clients_list` (attribute)
- `window_active_sessions` (attribute)
- `window_active_sessions_list` (attribute)
- `window_activity` (attribute)
- `window_activity_flag` (attribute)
- `window_bell_flag` (attribute)
- `window_bigger` (attribute)
- `window_cell_height` (attribute)
- `window_cell_width` (attribute)
- `window_end_flag` (attribute)
- `window_flags` (attribute)
- `window_format` (attribute)
- `window_height` (attribute)
- `window_id` (attribute)
- `window_index` (attribute)
- `window_last_flag` (attribute)
- `window_layout` (attribute)
- `window_linked` (attribute)
- `window_linked_sessions` (attribute)
- `window_linked_sessions_list` (attribute)
- `window_marked_flag` (attribute)
- `window_name` (attribute)
- `window_offset_x` (attribute)
- `window_offset_y` (attribute)
- `window_panes` (attribute)
- `window_raw_flags` (attribute)
- `window_silence_flag` (attribute)
- `window_stack_index` (attribute)
- `window_start_flag` (attribute)
- `window_visible_layout` (attribute)
- `window_width` (attribute)
- `window_zoomed_flag` (attribute)
- `wrap_flag` (attribute)
- `_refresh` (method) — Refresh dataclass fields from a single ``list-*`` row.
