voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.49k stars 78 forks source link

Lazygit quit bug #170

Closed timsofteng closed 4 years ago

timsofteng commented 4 years ago
  1. Open lazygit by :FloatermNew lazygit.
  2. Try to close it by press "q" of Esc. And we will get empty terminal.
  3. If we try to close it by let g:floaterm_keymap_kill we will got errors messages.

Can you please fix it? Thanks

voldikss commented 4 years ago

I cannot reproduce it. Could you give me some screenshots?

timsofteng commented 4 years ago

Yes, sure. Check the gif please. Ctrl-t+q is just my shortcut for let g:floaterm_keymap_kill = '<C-t>q'

Expected befavior: Close floaterm as well as lazygit by pressing "q" in lazygit.

NOTICE: sorry for slow speed but please watch until the end.

Peek 2020-09-05 13-31

voldikss commented 4 years ago

I have seen the whole gif but still have no ideas. It might be related to your other configs.

Please try reproducing this issue with the minimal vimrc (Actually you should do it at first, and also post your vim/nvim version, as described in the issue template) and give me the feedback.

timsofteng commented 4 years ago

I can't do it with minimal vimrc because I'm using raw vim and plugins trigger from vimrc.

vim version: 8.2.716

Here is my vimrc file if it's make sense

`"Plugins configs source $HOME/.vim/plug-config/fzf.vim source $HOME/.vim/plug-config/floaterm.vim source $HOME/.vim/plug-config/repeat.vim source $HOME/.vim/plug-config/ticket.vim source $HOME/.vim/plug-config/fugitive.vim source $HOME/.vim/plug-config/ctrlsf.vim source $HOME/.vim/plug-config/deoplete.vim source $HOME/.vim/plug-config/closetag.vim source $HOME/.vim/plug-config/coc.vim source $HOME/.vim/plug-config/ale.vim source $HOME/.vim/plug-config/fern.vim

"set vim plugins source $HOME/.vim/vim-plug/plugins.vim

" Edit vimr configuration file nnoremap confe :vs $MYVIMRC " Reload vims configuration file nnoremap confr :source $MYVIMRC "vimplug nnoremap vimplug :vs ~/.vim/vim-plug/plugins.vim

set autoread " detect when a file is changed au BufEnter * :checktime

"added dialog before closing buffers set confirm

" allow buffer switching without saving "set hidden

set mouse=a "Mouse windows resizing set ttymouse=sgr

set tabstop=2 shiftwidth=2 expandtab

set nocompatible filetype off

set diffopt+=vertical " Always use vertical diffs

" Searching set ignorecase " case insensitive searching set smartcase " case-sensitive if expresson contains a capital letter set hlsearch " highlight search results set incsearch " set incremental search, like modern browsers

"Apperance set number set relativenumber set linebreak " set soft wrapping set cursorline " Highlight the line currently under cursor "set ttyfast " faster redrawing

"Частота обновления вима set updatetime=300

" Display command line’s tab complete options as a menu set wildmenu

" Buffers line "let g:airline#extensions#tabline#enabled = 1

"For correct appear in st-term let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum"

set termguicolors "set t_Co=256 " Colorscheme "set background=dark set background=light colorscheme solarized8

set encoding=utf-8 " Set font competable with icons set guifont=DejavuSansMono\ Nerd\ Font\ 10

"Disable ability change all letters to lowercase "in visual mode by press "u" xnoremap u "search word in visual mode by predding "//" vnoremap // y/\VC-R>=escape(@",'/\')<CR

"disable highlighting by double Esc nnoremap :noh

"jumping between buffers nnoremap n :bn nnoremap p :bp nnoremap d :BD

"remap leader key "let mapleader="'"

" augroup my-glyph-palette " autocmd! * " autocmd FileType fern call glyph_palette#apply() " autocmd FileType nerdtree,startify call glyph_palette#apply() " augroup END

"let g:fern_git_status#disable_submodules = 1 "let g:fern_git_status#disable_directories = 1 "let g:fern_git_status#disable_ignored = 1 "let g:fern_git_status#disable_untracked = 1

"для Prettier nnoremap p :Prettier "js hi def link jsObjectKey Type

"vue let g:vim_vue_plugin_use_scss = 1 let g:vim_vue_plugin_load_full_syntax = 1 let g:vim_vue_plugin_highlight_vue_attr = 1 let g:vim_vue_plugin_highlight_vue_keyword = 1

"css colors let g:Hexokinase_highlighters = [ 'sign_column' ]

syntax enable syntax sync fromstart`

voldikss commented 4 years ago

source $HOME/.vim/plug-config/floaterm.vim

What's the content of plug-config/floaterm.vim?

timsofteng commented 4 years ago

source $HOME/.vim/plug-config/floaterm.vim

What's the content of plug-config/floaterm.vim?

image

timsofteng commented 4 years ago

So have you reproduce it? Can it be fixed?

Thanks

timsofteng commented 4 years ago

By the way :FloatermNew nnn works ok in this way. It can be closed without any issues.

voldikss commented 4 years ago

So have you reproduce it? Can it be fixed?

Thanks

Yes, it has existed for a long time(only in Vim).

timsofteng commented 4 years ago

Yes, it has existed for a long time(only in Vim).

Sorry, I'm not sure I correctly understand You. Is it mean you cannot fix it?

voldikss commented 4 years ago

Is it mean you cannot fix it?

I think I can fix it.

Sorry, I'm not sure I correctly understand You.

I reproduced it just now, and then I tried git checkout ... and found that this bug has existed for a long time but I even wasn't aware of it until just now.

timsofteng commented 4 years ago

I reproduced it just now, and then I tried git checkout ... and found that this bug has existed for a long time but I even wasn't aware of it until just now.

Got it. Thanks for fast support. I will waiting for fix.

p.s Do you remember my another issue about nnn bug? When you try open something in nnn with "o" button. This bug is still exist.

voldikss commented 4 years ago

Oh, this is not a bug, it's a feature! :joy:

Put this line to your vimrc and it should be work!

let g:floaterm_autoclose = 1

If I set g:floaterm_autoclose to 0 in neovim, pressing q will quit lazygit and leaves an empty window like this.

image

But in vim, whose terminal implemention is not the same as neovim's. Even it also leaves an empty window however we can not see the messages like [Process exited 0](Don't know why)...

voldikss commented 4 years ago

p.s Do you remember my another issue about nnn bug? When you try open something in nnn with "o" button. This bug is still exist.

Yes, I have no solutions yet.

voldikss commented 4 years ago

Let me close this issue as it must be solved.

timsofteng commented 4 years ago

let g:floaterm_autoclose = 1

Great! Thanks a lot!:) It works now.

P.s I found one more little but in NNN. I'll open new issue for it soon.