Replace tmux send-keys/select-pane commands with split-window args #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
First, I just want to say that I really appreciate this plugin, and thanks for all of the work on t!
I started using it with
tmux
recently, and really like the launching, but found it's behavior to be somewhat non-ideal.Problem statement
When I run
:SClangStart
, a new pane is correctly created with the desired orientation and size, and the sc pipe command is typed, but not started. The focus remains on the newly created tab, and I must press the Enter key to kick off the command, and then manually navigate back to the original pane. Furthermore, if I run:SClangKill
, Ctrl-csclang
or exit vim, the new pane remains open and is just a new shell now.The
tmux
command generated inftplugin/supercollider.vim
scvim/ftplugin/supercollider.vim
Lines 262 to 263 in d80cf6e
ends up looking something like
or:
start_pipe
command and the enter keyOn 4 computers I tested this on, the
send-keys
approach can never kick off the command and return to the original tmux pane.Proposed fix
In looking at the man page for
tmux
, I found thatsplit-window
has flags for the behavior that thesend-keys
andselect-pane
are currently handling, and they work more reliably and in a more expected way.An example of the command generated by the refactor in this PR is:
in other words:
-d
, do not focus the new panestart_pipe
command and close pane whensclang
stops for any reason.This works reliably, immediately, and more ergonomically than the current approach, and feels more consistent with the behavior I was seeing when I wasn't using a terminal multiplexer.
Thanks again!