tmuxp icon indicating copy to clipboard operation
tmuxp copied to clipboard

`tmuxp run-script`

Open tony opened this issue 3 years ago • 0 comments

Rather than having a tmuxp load <config> a user can run tmuxp run <script-path>, it can do any combination of:

  • Build / detect / modify existing server, session, window and panes
  • Attach session or keep it in the background

See also:

https://github.com/vcs-python/vcspull/issues/335



def run(server: 'libtmux.Server`):
    session.new_session(session_name="my session")
    # custom setup
    session.attach_session()

Todo

  • A way to pass arguments / add_arguments()
    • Just use argparse? Make sure tmuxp run-script [script_file_path] --help works

Inspiration

  • https://github.com/django-extensions/django-extensions/blob/3.1.5/django_extensions/management/commands/runscript.py

    These other one's require registration which may be too much effort to setup:

    • https://docs.djangoproject.com/en/4.0/howto/custom-management-commands/
    • flask custom commands

tony avatar Mar 28 '22 11:03 tony