Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ EOF

When writing documentation (README, CHANGES, docs/), follow these rules for code blocks:

**One command per code block.** This makes commands individually copyable.
**One command per code block.** This makes commands individually copyable. For sequential commands, either use separate code blocks or chain them with `&&` or `;` and `\` continuations (keeping it one logical command).

**Put explanations outside the code block**, not as comments inside.

Expand Down Expand Up @@ -464,6 +464,42 @@ $ uv run pytest
$ uv run pytest --cov
```

### Shell Command Formatting

These rules apply to shell commands in documentation (README, CHANGES, docs/), **not** to Python doctests.

**Use `console` language tag with `$ ` prefix.** This distinguishes interactive commands from scripts and enables prompt-aware copy in many terminals.

Good:

```console
$ uv run pytest
```

Bad:

```bash
uv run pytest
```

**Split long commands with `\` for readability.** Each flag or flag+value pair gets its own continuation line, indented. Positional parameters go on the final line.

Good:

```console
$ pipx install \
--suffix=@next \
--pip-args '\--pre' \
--force \
'libtmux'
```

Bad:

```console
$ pipx install --suffix=@next --pip-args '\--pre' --force 'libtmux'
```

## Debugging Tips

When stuck in debugging loops:
Expand Down
6 changes: 5 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ $ pip install --user --upgrade --pre libtmux
[pipx](https://pypa.github.io/pipx/docs/):

```console
$ pipx install --suffix=@next 'libtmux' --pip-args '\--pre' --force
$ pipx install \
--suffix=@next \
--pip-args '\--pre' \
--force \
'libtmux'
// Usage: libtmux@next [command]
```

Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,30 @@ Maintenance-only backports (no new fixes):

Stable release:

```bash
pip install libtmux
```console
$ pip install libtmux
```

With pipx:

```bash
pipx install libtmux
```console
$ pipx install libtmux
```

With uv / uvx:

```bash
uv add libtmux
uvx --from "libtmux" python
```console
$ uv add libtmux
```

```console
$ uvx --from "libtmux" python
```

From the main branch (bleeding edge):

```bash
pip install 'git+https://github.com/tmux-python/libtmux.git'
```console
$ pip install 'git+https://github.com/tmux-python/libtmux.git'
```

Tip: libtmux is pre-1.0. Pin a range in projects to avoid surprises:
Expand Down Expand Up @@ -94,6 +97,9 @@ Use [ptpython], [ipython], etc. for a nice REPL with autocompletions:

```console
$ pip install --user ptpython
```

```console
$ ptpython
```

Expand Down
28 changes: 22 additions & 6 deletions docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ $ make start
### Manual documentation (the hard way)

```console
$ cd docs/
$ make html
$ cd docs/ && make html
```

to build.
Expand All @@ -86,8 +85,16 @@ $ make serve
to start http server.

Helpers:

Build docs:

```console
$ make build_docs
```

Serve docs:

```console
$ make serve_docs
```

Expand Down Expand Up @@ -278,10 +285,19 @@ building, and publishing. Therefore there is no setup.py or requirements files.
Update `__version__` in `__about__.py` and `pyproject.toml`:

```console
git commit -m 'build(libtmux): Tag v0.1.1'
git tag v0.1.1
git push
git push --tags
$ git commit -m 'build(libtmux): Tag v0.1.1'
```

```console
$ git tag v0.1.1
```

```console
$ git push
```

```console
$ git push --tags
```

[twine]: https://twine.readthedocs.io/
Expand Down
14 changes: 11 additions & 3 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ the 4th beta release of `1.10.0` before general availability.
- [pipx]\:

```console
$ pipx install --suffix=@next 'libtmux' --pip-args '\--pre' --force
// Usage: libtmux@next [command]
$ pipx install \
--suffix=@next \
--pip-args '\--pre' \
--force \
'libtmux'
```

Usage: `libtmux@next [command]`

- [uv tool install][uv-tools]\:

```console
Expand Down Expand Up @@ -77,7 +82,10 @@ via trunk (can break easily):
- [pipx]\:

```console
$ pipx install --suffix=@master 'libtmux @ git+https://github.com/tmux-python/libtmux.git@master' --force
$ pipx install \
--suffix=@master \
--force \
'libtmux @ git+https://github.com/tmux-python/libtmux.git@master'
```

- [uv]\:
Expand Down
Loading