Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
docs(sleep): Sleep command
  • Loading branch information
tony committed Mar 13, 2022
commit 93b4ff11f5e34da8bfe7171debd4b21e97296895
27 changes: 27 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,33 @@ Omit sending {kbd}`enter` to key commands. Equivalent to

````

## Pause / delay command execution

```{versionadded} 1.10.0bX
`sleep: [seconds]` option
```

Omit sending {kbd}`enter` to key commands. Equivalent to
[`time.sleep()`](time.sleep) before [`send_keys(enter=False)`](libtmux.Pane.send_keys).

````{tab} YAML

```{literalinclude} ../examples/sleep.yaml
:language: yaml

```

````

````{tab} JSON

```{literalinclude} ../examples/sleep.json
:language: json

```

````

## Window Index

You can specify a window's index using the `window_index` property. Windows
Expand Down
13 changes: 13 additions & 0 deletions examples/sleep.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"session_name": "Should sleep 3 seconds before sending pane commands",
"windows": [
{
"panes": [
{
"shell_command": "echo \"___$((1 + 3))___\"",
"sleep": 3
}
]
}
]
}
5 changes: 5 additions & 0 deletions examples/sleep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
session_name: Should sleep 3 seconds before sending pane commands
windows:
- panes:
- shell_command: echo "___$((1 + 3))___"
sleep: 3