# libtmux.Session._refresh

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/neo.py#L490
- **Inherited from:** libtmux.neo.Obj
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-session-_refresh/

```
libtmux.Session._refresh(
    self,
    obj_key: str,
    obj_id: str,
    list_cmd: ListCmd = "list-panes",
    list_extra_args: ListExtraArgs = None,
) -> None
```

Refresh dataclass fields from a single ``list-*`` row.

Used by the public ``refresh()`` methods on :class:`~libtmux.Pane`,
:class:`~libtmux.Window`, :class:`~libtmux.Session`, and
:class:`~libtmux.Client`. Each subclass guards its identity field
([`pane_id`](/en/tmux/latest/catalog/formats/pane_id/), [`window_id`](/en/tmux/latest/catalog/formats/window_id/), [`session_id`](/en/tmux/latest/catalog/formats/session_id/), [`client_name`](/en/tmux/latest/catalog/formats/client_name/))
against ``None`` before delegating here; this base method enforces
the same precondition explicitly so the guarantee survives
``python -O``, where an ``assert`` would be stripped.

## Parameters

- `obj_key` (`str`)
- `obj_id` (`str`)
- `list_cmd` (`ListCmd`)
- `list_extra_args` (`ListExtraArgs`)

## Raises

- [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError): When ``obj_id`` is ``None``. Surfaces a clear error under
``python -O``, matching the contract of the public ``refresh()``
methods.
