tmux-python / tmux-python/tmuxp

shell_command with tmux command causes unpredictable behavior

Open
#451 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Somewhere in the current (from git) tmux and current tmuxp, I've lost the ability to run tmux layout tweaking code from a pane command.

Use case: I want a simple layout not covered by tmux's stock layouts, one pane 80 columns, the other pane the rest of the screen width. This allows me to put terminal apps that expect 80 columns in a convenient pane that matches expectations. I was doing this with an initial starting command:
tmux split-window -h -l $(( $(tmux list-panes -F "#{pane_width}") - 82 )) (copied from a binding in my tmux config). This has stopped working somewhere in the updating of both tmux and tmuxp. Presumably this may be a tmux issue (as I believe it has the most recent updates). I had some look with replacing the complicated calculation with a similar, but shorter construct

     - focus: true
        shell_command:
           - tmux resize-pane -x 85
           - main command

but weird things break this. I can load a single window after this and the resize works, but two windows (unclear at this point what the trigger is) and two things happen:

  • the focus statement no longer works (it did with one following window).
  • The resize-pane option shows on the screen, but is not executed.

I'd appreciate alternate pointers about meeting my ends.

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

Reproduce the reported configuration using shell_command, tmux resize-pane, and one versus two windows, then compare behavior between tmux and tmuxp versions. Determine whether focus handling or command execution is responsible; done means the triggering conditions and an actionable fix or confirmed upstream cause are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, yaml
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.