Skip to content

Commit 9cb81b5

Browse files
committed
docs(examples): Show command and pane-level enter
1 parent 0470408 commit 9cb81b5

File tree

5 files changed

+66
-8
lines changed

5 files changed

+66
-8
lines changed

docs/examples.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ This will add the `shell_command` to the bash history in the pane.
331331
## Skip command execution
332332

333333
```{versionadded} 1.10.0b1
334-
`enter: false` option. This is only available at the pane (not command level)
335-
until [#751](https://github.com/tmux-python/tmuxp/issues/751) is published.
334+
`enter: false` option. Pane-level support.
335+
```{versionadded} 1.10.0b3
336+
Support command-level skipping.
336337
```
337338

338339
Omit sending {kbd}`enter` to key commands. Equivalent to
@@ -356,6 +357,25 @@ Omit sending {kbd}`enter` to key commands. Equivalent to
356357
357358
````
358359

360+
````{tab} YAML (pane-level)
361+
362+
```{literalinclude} ../examples/skip-send-pane-level.yaml
363+
:language: yaml
364+
365+
```
366+
367+
````
368+
369+
````{tab} JSON (pane-level)
370+
371+
```{literalinclude} ../examples/skip-send-pane-level.json
372+
:language: json
373+
374+
```
375+
376+
````
377+
378+
359379
## Window Index
360380

361381
You can specify a window's index using the `window_index` property. Windows

examples/skip-send-pane-level.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"session_name": "Skip all pane commands",
3+
"windows": [
4+
{
5+
"panes": [
6+
{
7+
"shell_command": "echo \"___$((1 + 3))___\"",
8+
"enter": false
9+
},
10+
{
11+
"shell_command": [
12+
"echo \"___$((1 + 3))___\"\\;",
13+
"echo \"___$((1 + 3))___\""
14+
],
15+
"enter": false
16+
}
17+
]
18+
}
19+
]
20+
}

examples/skip-send-pane-level.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
session_name: Skip all pane commands
2+
windows:
3+
- panes:
4+
- shell_command: echo "___$((1 + 3))___"
5+
enter: false
6+
- shell_command:
7+
- echo "___$((1 + 3))___"\;
8+
- echo "___$((1 + 3))___"
9+
enter: false

examples/skip-send.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
2-
"session_name": "Should not execute",
2+
"session_name": "Skip command execution (command-level)",
33
"windows": [
44
{
55
"panes": [
66
{
7-
"shell_command": "echo \"___$((1 + 3))___\"",
8-
"enter": false
7+
"shell_command": [
8+
"echo \"___$((11 + 1))___\"",
9+
{
10+
"cmd": "echo \"___$((1 + 3))___\"",
11+
"enter": false
12+
}
13+
]
914
}
1015
]
1116
}

examples/skip-send.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
session_name: Should not execute
1+
session_name: Skip command execution (command-level)
22
windows:
33
- panes:
4-
- shell_command: echo "___$((1 + 3))___"
5-
enter: false
4+
- shell_command:
5+
# You can see this
6+
- echo "___$((11 + 1))___"
7+
# This is skipped
8+
- cmd: echo "___$((1 + 3))___"
9+
enter: false

0 commit comments

Comments
 (0)