Skip to content

Commit d24226e

Browse files
committed
docs(quickstart): Add options section with examples (#516)
why: Users following the quickstart guide need to see basic options usage alongside other common operations like creating windows and panes. what: - Add "Working with options" section before "Final notes" - Include examples for show_option(), show_options(), set_option(), unset_option() - Add seealso reference to the detailed options-and-hooks topic guide - All doctests pass via pytest --doctest-glob
1 parent 9440065 commit d24226e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/quickstart.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,38 @@ automatically sent, the leading space character prevents adding it to the user's
441441
shell history. Omitting `enter=false` means the default behavior (sending the
442442
command) is done, without needing to use `pane.enter()` after.
443443

444+
## Working with options
445+
446+
libtmux provides a unified API for managing tmux options across Server, Session,
447+
Window, and Pane objects.
448+
449+
### Getting options
450+
451+
```python
452+
>>> server.show_option('buffer-limit')
453+
50
454+
455+
>>> window.show_options() # doctest: +ELLIPSIS
456+
{...}
457+
```
458+
459+
### Setting options
460+
461+
```python
462+
>>> window.set_option('automatic-rename', False) # doctest: +ELLIPSIS
463+
Window(@... ...)
464+
465+
>>> window.show_option('automatic-rename')
466+
False
467+
468+
>>> window.unset_option('automatic-rename') # doctest: +ELLIPSIS
469+
Window(@... ...)
470+
```
471+
472+
:::{seealso}
473+
See {ref}`options-and-hooks` for more details on options and hooks.
474+
:::
475+
444476
## Final notes
445477

446478
These objects created use tmux's internal usage of ID's to make servers,

0 commit comments

Comments
 (0)