Tests are run with vim-dispatch
and this command:
:Dispatch bundle exec rspec spec/path/to/file_spec.rb
vim-dispatch
creates a new tmux pane where it runs the command. The output of the command is fed to Vim.
Sometimes the STDOUT output produced by bundle exec rspec
is malformed. Lines are missing, or merged together.
First idea was that it's a problem with Vim's :compiler
setting and the way the vim-ruby
RSpec compiler parses output. It turns out, that's not the case. That's been fixed (thoughtbot/vim-rspec#105). The problem also isn't with vim-dispatch
and which :compiler
it sets:
The rspec
compiler is never used, since I use bundle exec rspec
. But with this in the .vimrc
it's possible to configure vim-dispatch
to ignore bundle exec
when determining the compiler:
let g:dispatch_compilers = { 'bundle exec': ''}
Between 2.2 and 2.3 there have been changes in tmux that broke the tmux pipe-pane
command, which vim-dispatch
uses to capture the output of commands:
The author of the change in tmux speculates, that he "must have been on crack when [he] did this" (tmux/tmux#594)
The change has been reverted on the tmux master branch.
In any case: add the dispatch_compilers
config to vimrc.
For the missing output:
-
Upgrade to tmux master (2.4 is unreleased as of writing). That fixes the
vim-dispatch
problems. But it also has backwards-incompatible changes in the.tmux.conf
format, breaking key bindings in the (yeah, you guessed it)vi-copy-mode
of tmux. The syntax changed:bind-key -t vi-copy ... # before bind-key -T copy-mode-vi ... # after # See: https://github.com/tmux/tmux/issues/754
This solution means upgrading tmux on every computer to master
and changing the config to the still unstable, new format.
- Use the
shellpipe
config-hack discussed in tpope/vim-dispatch#192 -- this sometimes works and sometimes doesn't.
tmux 2.4 has been released: https://raw.githubusercontent.com/tmux/tmux/master/CHANGES