shell_command with tmux command causes unpredictable behavior
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.
I've found a partial workaround, specifying target in the resize command. Focus is still unpredictable. It makes good sense that a tmux command as a shell_command is... problematic. Is it possible to add a complement to before_script to allow end of setup tmux tweaks?
More reading, and I see the possibility of freeze or explicit layouts, but this approach is fragile for my use case, as it depends on absolute terminal viewport size, something that's unreliable for me (resizable xterm and differing screen sizes).
@fourjay I know its been a while since this issue was created and I am unsure of all of what was added to the project between the creation of this issue and now, but I was wondering if the options_after would solve this issue (example config) along with the tmux window options of main-pane-height, main-pane-width, other-pane-height, and other-pane-width?
If this doesn't work, as of version 1.7.0, there is a plugin system that includes an after_window_finished hook that could be used to get exactly what you need.