Closed blelump closed 7 years ago
@blelump Sorry to hear about the trouble. It sounds as though this is a tmux issue, not specific to this plugin. Specifically, running tmux send-keys ...
while in a zoomed pane should maybe display a warning (or in my case it targets the zoomed pane, rather than the pane specified by -t <pane-index>
), but certainly not kill the server.
That said, we should probably handle this case a bit better regardless. Your workaround is very novel. I wonder if instead if the plugin should detect and unzoom if you try to send a command again.
I'm not sure I'll have time to work on this anytime soon, but if you're interested, feel free to put something together in a PR and I'd be happy to review.
@christoomey ,
thanks for answering !
Let me clarify the intention of that code above – perhaps I am missing something. I am using VTR
along with vim-test
plugin to run tests. The problem is that once you run a test and new Tmux pane appears, you're not able to easily hide (although closing is easy) the newly created pane. I think I don't want to close it permanently, because if the test has failed, I'd like to examine the stacktrace a few times, i.e. using VtrFocusRunner
feature, then go back to Vim, hide test pane and do some editing, then switch again to the test pane etc. I just would like to not kill the pane, but rather hide it so I'm able to go back and look into it. Is my way of thinking correct?
Hey @blelump, thanks for clarifying. When I first started the plugin I had a :VtrDetachRunner
command, but it's a bit flaky unfortunately. This is certainly something we could support, but would take some effort to do so.
While I hate to send you away, I think the use case your describing might actually be a perfect match for tpope's vim-dispatch which will use tmux if available, auto-hide on test success, and keep the pane open on failures. I personally like to keep the pane open all the time and more explicitly manage the tmux running, thus the existence of this plugin, but based on what you've described, I think dispatch might be a perfect fit for you.
Sorry I couldn't give a better answer, but hopefully that clarifies things.
I'm going to close this now as I believe the crashing of tmux is unrelated to this plugin, and I think any work towards the workflow you're describing is better captured in https://github.com/christoomey/vim-tmux-runner/issues/66, but please feel free to comment or reopen if you think I've missed something.
@christoomey ,
sure, thanks for clarification !
Hi @christoomey ,
first of all, huge thanks for your contributions into this plugin. I've encountered an issue while working with attached pane. Let me clarify it with these steps to reproduce:
:VtrSendCommand! ls
to attach pane and getls
output (just for the sake of the example);:VtrSendCommandToRunner echo "ok"
– all is still fine and both, vim and shell panes are visible;^prefix + Z
from within Tmux so the vim pane is now zoomed/maximized.:VtrSendCommandToRunner echo "ok"
again – you get[lost server]
and the Tmux server is killed.A workaround might be to use
VtrKillRunner
each time vim pane is zoomed so any further 'shell pane' invocations will attach to a new pane.Edit
I've ended up with the function given below. It is used with
vim-test
plugin altogether. If you have a better idea of solving it, feel free to share :smile: .