christoomey / vim-tmux-runner

Vim and tmux, sittin' in a tree...
MIT License
291 stars 37 forks source link

Runner pane setting (0) is invalid. please reattach #53

Closed msempere closed 7 years ago

msempere commented 9 years ago

Hi, I'm getting the following error when pressing or to open the runer:

"Runner pane setting (0) is invalid. please reattach"

And when I try to attach it manually using VtrAttachToPane and selecting the pane, I'm getting:

"VTR: Invalid pane number: 0"

christoomey commented 9 years ago

Hello @msempere,

Are you using the setting for base-pane-index 1 by any chance?

msempere commented 9 years ago

Hi @christoomey , No I'm not. I'm using the default configuration for tmux, so my tmux.conf file it's completely empty. So I suppose that by default is using the correct behaviour, right? Thanks

christoomey commented 9 years ago

Hi @msempere, nothing is coming to mind. I also use the default (zero based pane indices) and just confirmed that I was able to attach to the alt pane when it (the alternate / non-vim pane) was at index 0.

Could you push your .tmux.conf file up to your dotfiles and link that here? Might be something in that that is causing this. Also, can you confirm the version of the plugin you are using (you can do this by going to the repo, cd ~/.vim/bundle/vim-tmux-runner, and then run git --no-pager log --oneline -1).

msempere commented 9 years ago

Hi @christoomey ,

My tmux.conf file only contains the following line:

"set -g default-terminal "screen-256color"

And the output for that command returns:

"515f7d8 Prevent kill wrong background window"

msempere commented 9 years ago

@christoomey Do you need more information?

christoomey commented 9 years ago

Hi @msempere, can you define the specific steps you are using to reproduce this? I'm unable to reproduce on my end, but might be doing something different.

msempere commented 9 years ago

@christoomey I'm using spf13-vim and Tmux. For the installation, I used Vundle with vim-tmux-runner.

christoomey commented 9 years ago

Sorry, what I meant was the sequence of steps you use that cause the error. Something like:

  1. Two tmux panes, left and right
  2. Open Vim in left tmux pane
  3. Try to run :VtrSendCommandToRunner
  4. See error message

It would also be useful if you could tell me the pane indices (you can see them with tmux keybinding <prefix>q)

msempere commented 9 years ago

@christoomey

Only one pane with index 0

  1. attach to that tmux session
  2. open vim
  3. run :VtrSendCommandToRunner("echo 1")
  4. Error: VTR: No runner pane attached.

Starting with one pane with index 0

  1. attach to that tmux session
  2. open vim
  3. run :VtrOpenRunner (main pane has index 0 and runner 1)
  4. run :VtrFocusRunner (from pane 0)
  5. Error: VTR: Runner pane setting (0) is invalid. Please reattach.
christoomey commented 9 years ago

Hi @msempere, I'm unfortunately unable to reproduce on my side. At this point I'll have to look into the specifics of that check to confirm.

One potential issue might be your version of tmux and the output of the display-message command in tmux. Can you try running :call system("display-message -p \"#{pane_index}\"") directly in Vim and confirm the output?

Additionally can you confirm the output of tmux list-panes when run in your shell?

msempere commented 9 years ago

If I run :call system("display-message -p \"#{pane_index}\"") from inside vim I don't get any result. Running tmux list-panes: 0: [237x66] [history 1961/2000, 1031773 bytes] %37 (active)

christoomey commented 9 years ago

Sorry, the :call needs to be :echo to actually print out what the command returns. My bad!

Can try :echo system("display-message -p \"#{pane_index}\"")

WuTheFWasThat commented 8 years ago

@christoomey

i'm hitting this same problem. but i am using base-pane-index 1.
the funny thing is, everything seems to work fine until i try to use VtrReorientRunner. once i try to reorient, all other commands appear to break as well

(and fyi, i just found this plugin today, and it's fantastic! seems like it is probably gonna change my workflow a lot)

christoomey commented 8 years ago

Hey @WuTheFWasThat, sorry to hear about the trouble. VtrReorientRunner was a nifty feature that I expected I'd use a ton, but as time has gone on I find myself just manually manipulating panes for sizing and positioning and re-attaching as needed. Unfortunately the implementation is a bit brittle and you seem to have run into an edge case. Hopefully I can fix it up at some point (or possibly deprecate it?). That said, I'm really glad you're enjoying the plugin overall!

nomasprime commented 3 years ago

Interesting plug-in but using with pane-base-index 1 still doesn't work.

@christoomey agree manually manipulating panes is straightforward enough but this issue should still be a bug unless the option's removed altogether.

PS pane-base-index and related base-index set to 1 is probably an easier mental model and more efficient.