skywind3000 / vim-terminal-help

Small changes make vim/nvim's internal terminal great again !!
MIT License
247 stars 32 forks source link

Unable to close after focus change #19

Closed Shatur closed 4 years ago

Shatur commented 4 years ago

Steps to reproduce

  1. Show terminal.
  2. Change focus to any other window.
  3. Try to toggle it.

Actual behavior: Toggle not works and Neovim prints the following error: изображение

Expected behavior: Terminal toggled.

skywind3000 commented 4 years ago

sorry, I can't reproduce it , what option did you set

Shatur commented 4 years ago

Here is the all my options for this plugin:

let g:terminal_key = '<F4>'
let g:terminal_height = 15

Here is the video, maybe it will describe the issue a little bit more: asciicast

skywind3000 commented 4 years ago

are you using the latest version ?? In the latest version, line 18 of TerminalClose is not a close statement.

Shatur commented 4 years ago

Yes, I using the latest master. I tried to run without configuration (sorry, I had to do it first) and came to the conclusion that the problem is the following mappings:

nnoremap <Leader>w <C-w>
noremap <C-w> :w<CR>

Is I doing something wrong? Without them the plugin works as expected.

skywind3000 commented 4 years ago

because you override <c-w> , it is an important key in vim, never saw any body remap it before. and it is used in the plugin. Your map change some of the behavior.

<c-s> is useless in vim, and <m-s> or <m-w> is unused too.

skywind3000 commented 4 years ago

fixed, no conflict any more.

Shatur commented 4 years ago

Yes, it helped, thank you!

Yes, I just remapped it. I like solution with <C-s>, but it not works in CLI (it sends vim to background). You can also use :wincmd in plugin that works like <C-w>.

skywind3000 commented 4 years ago

add this in your .bashrc:

stty -ixon

it makes <c-s> available in terminal

findNextStep commented 4 years ago

Yes, it helped, thank you!

Yes, I just remapped it. I like solution with <C-s>, but it not works in CLI (it sends vim to background). You can also use :wincmd in plugin that works like <C-w>.

use stty -ixon can help use in command line see https://unix.stackexchange.com/questions/72086/ctrl-s-hang-terminal-emulator

Shatur commented 4 years ago

Did not know about it, thanks!