Skip to content

Commit c5aa46c

Browse files
committed
docs(CHANGES): Automation patterns waits for tmux
what: - Record the automation-patterns rewrite under `Documentation`.
1 parent e2b60cf commit c5aa46c

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

CHANGES

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ _Notes on the upcoming release will go here._
4747

4848
### Documentation
4949

50+
#### Automation patterns waits for tmux instead of guessing (#734)
51+
52+
The examples on {ref}`automation-patterns` waited for a command to finish by
53+
sleeping a fixed amount and then reading the pane. A sleep long enough to be
54+
safe is dead time on every run, and one short enough to feel quick reports
55+
failure on a busy machine.
56+
57+
They now have the command signal a channel when it finishes and block on that
58+
with {meth}`Server.wait_for() <libtmux.Server.wait_for>`, which returns the
59+
moment the command is done. Checks compare whole captured lines rather than
60+
searching the joined capture, because {meth}`~libtmux.Pane.capture_pane`
61+
returns the command tmux echoed onto the pane -- a substring search matches
62+
that echo and is already true before the shell has run.
63+
5064
#### Cleaner `from_env` examples (#719)
5165

5266
The rendered examples for {meth}`Pane.from_env() <libtmux.Pane.from_env>` and

0 commit comments

Comments
 (0)