tmux-python / tmux-python/tmuxp

Feature request: `before_script_inline`

Open
#966 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.6k
Forks
248
Avg merge
2h 13m
Merged PRs (30d)
1

Description

Hey! Amazing project, very well executed!

My feature request: possibility for inlining a whole script in in before_script, e.g.:

#!/usr/bin/tmuxp load

session_name: shorthands
# global_options:
#   socket_path: /tmp/socksock
start_directory: /tmp
environment:
  HISTFILE: ''
suppress_history: false
before_script_inline: |
  set -eou pipefail
  /home/foobar/complicated-stuff | with pipes && and special shell syntax, whatevers
  false || true 
windows:
  ...

tmuxp should still check the exit value, and the whole script should be piped to $SHELL, so the user can use whichever shell they prefer. Other than that, I think it should behave similar to before_script, so similar PWD, environment, etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the existing before_script implementation and its configuration validation, then compare its working directory and environment handling with the requested inline form. Done means a multiline before_script_inline value is passed to $SHELL, preserves the relevant context, and reports the script's exit status.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.