tmux-python / tmux-python/tmuxp
Eval python code
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 248
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 1
Description
In addition to our plugin system #530 #628
We can allow inserting of scripts into "commands"
pane.eval
windows:
panes:
- shell_command:
- eval: >
def run(pane):
# total access up the tree
window = pane.window
session = pane.window.session
server = pane.window.server.server
pane.send_keys(f'echo "ran this by hand in {window.window_name} of {session.session_name} in {server}', enter=True)
- cmd: echo "hello"
pane.eval_script
See also tmuxp run-script #772
script.sh:
def run(pane):
# total access up the tree
window = pane.window
session = pane.window.session
server = pane.window.server.server
pane.send_keys(f'echo "ran this by hand in {window.window_name} of {session.session_name} in {server}', enter=True)
windows:
panes:
- shell_command:
- eval_script: script.py
- cmd: echo "hello"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the plugin-system issues #530 and #628, then compare the related tmuxp run-script proposal in #772. Define how the YAML pane.eval and pane.eval_script entries should execute the shown Python run(pane) function, and consider the issue complete when both examples work alongside the existing command entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100