wincent / terminus

🖥 Enhanced terminal integration for Vim
BSD 2-Clause "Simplified" License
463 stars 25 forks source link

Weired issue in nested terminal inside vim #47

Open eyalz800 opened 4 years ago

eyalz800 commented 4 years ago

Description: The string "2 q" appears on the screen when exiting insert mode in vim (via escape), which runs inside a terminal that was opened in vim, which runs inside tmux.

This may sound like an extreme edge case, however, it is pretty common in my workflow to have vim running inside tmux, and then have a terminal inside vim to perform git commit (which opens vim).

This also happens with plugins that use terminal such as lazygit, etc, because they launch vim inside for committing.

If it helps, I thought initially this was a bug with vim, but it happens only when your plugin is loaded, the bug was introduced between v8.2.0797 and v8.2.0798, when the plugin is used, by the following commit https://github.com/vim/vim/commit/be593bf135f6967335b14ba188bd5f8f32175c75

Reproduction steps: Detailed steps to reproduce the behavior:

  1. Compile & Install vim v8.2.0798 (The first revision where the bug was introduced), features huge.
  2. Open tmux session (tmux version 3.1b)
  3. Start vim inside (with plugin installed).
  4. Open a terminal inside vim (:terminal)
  5. Launch vim inside the terminal.
  6. Go to insert mode and hit , "2 q" string appears after the cursor.
  7. Go into insert mode, "6 q" string appears next to the 'insert' notice in the status bar.

Expected behavior Behave normally, no strings should be printed on the screen when pressing escape or entering insert mode.

Screenshots: See here image of the behavior: image

Here in insert mode also look at the "6 q" below: image

Environment: