ilyachur/cmake4vim

Glitchy tmux output window when dispatch message is too long

sam20908 opened this issue · 9 comments

Describe the bug
When using vim-dispatch and doing :CMake, the output names from tmux most of the time won't get closed, hence leaving a black space on the bottom

To Reproduce
Steps to reproduce the behavior:

  1. Make a project directory with the following files:
  • CMakeLists.txt the file can be empty
  • Set the following settings (I've done it via .nvimrc):
    Note that the compiler can be anything, it just has to be a C++ compiler
let g:cmake_cxx_compiler = 'clang-11'
let g:cmake_compile_commands = 1
  1. cd into the project directory
  2. Run :CMake

Expected behavior
The black output window should disappear

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. Wndows, macOS] Windows with WSL 2
  • Editor [e.g. vim, nvim] nvim
  • Version [e.g. 8.1] Windows 10 & Ubuntu 20.04 in WSL

Additional context

Hi @sam20908,

It doesn't look like a plugin issue. I double checked the places where I use dispatch and it is called only one time to generate CMake project (for :CMake command)
Moreover it doesn't depend on g:cmake_cxx_compiler or g:cmake_compile_commands variables.

I have simplified the reproducer and it looks like a Dispatch issue.
To reproduce I called next commands:

:let &l:makeprg='cmake -DCMAKE_BUILD_TYPE=Release  -B /tmp/cmake4vim/test/test\ proj/cmake-build-Release -S /tmp/cmake4vim/test/test\ proj'
:Make

And I also have in some moments the tmux black window which disappears after the several seconds.

@ilyachur Thanks for the reduced repro.

It's weird that I can use commands like :CMakeBuild and it'll work fine all the time (and that's how I get rid of the black window).

@ilyachur Thanks for the reduced repro.

It's weird that I can use commands like :CMakeBuild and it'll work fine all the time (and that's how I get rid of the black window).

I am not sure, that the problem depends on the command (cmake generate or build) if I remember right I also saw the same behavior after the build.
I am pretty sure that it is not the plugin issue.

@ilyachur Thanks for the reduced repro.
It's weird that I can use commands like :CMakeBuild and it'll work fine all the time (and that's how I get rid of the black window).

I am not sure, that the problem depends on the command (cmake generate or build) if I remember right I also saw the same behavior after the build.
I am pretty sure that it is not the plugin issue.

Ah okay. Should I file an issue to the dispatcher plugin then?

BTW, I found out that set cmdheight=2 somehow made it disappear. I was wondering if you can test it using that too @ilyachur?

I tested it since I had the same problem and it fixes it, thanks!

I think it's because the message from Dispatch is longer than the width of the line, so cmdheight allows the entire message to be displayed.

That being said, I wonder if Dispatch should handle long messages since it's technically a bug?