Skip to content

Commit 185eb4d

Browse files
committed
docs: Note yaml multiline commands
1 parent 78c3b08 commit 185eb4d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/examples.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,36 @@ pane during creation.
387387

388388
```
389389

390+
391+
## Multi-line commands
392+
393+
You can use YAML's multiline syntax to easily split multiple
394+
commands into the same shell command: https://stackoverflow.com/a/21699210
395+
396+
```{code-block} yaml
397+
398+
session_name: my project
399+
shell_command_before:
400+
- >
401+
[ -d `.venv/bin/activate` ] &&
402+
source .venv/bin/activate &&
403+
reset
404+
- sleep 1
405+
windows:
406+
- window_name: first window
407+
layout: main-horizontal
408+
focus: true
409+
panes:
410+
- focus: True
411+
- blank
412+
- >
413+
poetry run ./manage.py migrate &&
414+
npm -C js run start
415+
- poetry run ./manage.py runserver
416+
options:
417+
main-pane-height: 35
418+
```
419+
390420
## Bootstrap project before launch
391421

392422
You can use `before_script` to run a script before the tmux session

0 commit comments

Comments
 (0)