LoricAndre / OneTerm.nvim

One terminal plugin to rule them all ! (eventually)
53 stars 1 forks source link

term is always creating new instances #5

Closed aMOPel closed 3 years ago

aMOPel commented 3 years ago

also i noticed when i close the term window now with c-\ c-n c-w c vim creates a new empty line in the current buffer

aMOPel commented 3 years ago

also i noticed when i close the term window now with c-\ c-n c-w c vim creates a new empty line in the current buffer

actually that stopped happening

LoricAndre commented 3 years ago

Great news ! Sorry about all that, I pushed some changes to main far too early...

aMOPel commented 3 years ago

i dont really know what would help you with debugging it is opening xterm-256color which is a different terminal than my default which is kitty, but i do get my default shell zsh with configs loaded, maybe its connected to the way zsh works?

LoricAndre commented 3 years ago

I'm extracting the shell from $SHELL. The terminal isn't an instance of your terminal, neovim can't really do that. Instead, it spawns one of its own terminals.

aMOPel commented 3 years ago

yes, maybe lets try hardcoding the shell to bash or sh or smth and see if it then works for me, or what are you using?

aMOPel commented 3 years ago

ill change my $SHELL wait

LoricAndre commented 3 years ago

Neovim can't spawn a new floating kitty instance if that's what you're looking for, you'd need a global keybind and some WM rules

aMOPel commented 3 years ago

Neovim can't spawn a new floating kitty instance if that's what you're looking for, you'd need a global keybind and some WM rules

nah thats fine

aMOPel commented 3 years ago

ill change my $SHELL wait

so it is still happening with sh

LoricAndre commented 3 years ago

I think I'm lost, what exactly is happening ?

aMOPel commented 3 years ago

oh im sorry,

so you said the terminal would be persistent, what im doing to test it is

  1. :OneTerm term
  2. echo "hi" to get some output
  3. close the term with c-\ c-n c-w c
  4. :OneTerm term again to see if its still there

but its not, its just a blank shell

LoricAndre commented 3 years ago

Oh I thought that's what you meant in

also i noticed when i close the term window now with c-\ c-n c-w c vim creates a new empty line in the current buffer

actually that stopped happening

sorry, I didn't read the whole answer ^^'

aMOPel commented 3 years ago

so since we are on the same page now, i tested setting my $SHELL to sh and it still opened a new instance, meaning its not my zsh config or smth weird with it. what else could it depend on?

LoricAndre commented 3 years ago

Could you manually try to jump to a terminal buffer ? You can list them using :ls and jump to them by number with :b.

aMOPel commented 3 years ago

Could you manually try to jump to a terminal buffer ? You can list them using :ls and jump to them by number with :b.

i pulled a few minutes ago, currently it is killing the term buffer when i close the window, when i do :ls i only get the current open file

aMOPel commented 3 years ago

also something else is happening: when i close the term now i get either Error executing vim.schedule lua callback: vim.lua:492: Vim(tabnew):E194: No alternate file name to substitute for '#': tabnew #2 or its opening a new tab with the current file

aMOPel commented 3 years ago

i see i need to explicitly set hidden i had set nohidden in my vimrc and commented it out, but apparently its default. So i guess either you add it to the readme that you need to set hidden or you use some other way that is independent of hidden buffers.

aMOPel commented 3 years ago

the consequence of the hidden buffer is also that i cant just quit vim, i get: E948: Job still running E676: No matching autocommands for acwrite buffer so i need to forcequit, which i guess is alright, just something to consider

aMOPel commented 3 years ago

also something else is happening: when i close the term now i get either Error executing vim.schedule lua callback: vim.lua:492: Vim(tabnew):E194: No alternate file name to substitute for '#': tabnew #2 or its opening a new tab with the current file

this doesnt happen with set hidden

LoricAndre commented 3 years ago

The only possible way I can see this happening is if you were closing the terminal buffer you were ending the terminal job. Can you try something like :au TermClose * echo "Terminal closed" and then try again, tell me if you see a message ?

aMOPel commented 3 years ago

The only possible way I can see this happening is if you were closing the terminal buffer you were ending the terminal job. Can you try something like :au TermClose * echo "Terminal closed" and then try again, tell me if you see a message ?

with set nohidden i indeed get that message when closing the window, with set hidden i dont and it works fine, i guess you didnt read my prior comments when you wrote this

LoricAndre commented 3 years ago

Oh so you mean everything works with set hidden ?

aMOPel commented 3 years ago

i see i need to explicitly set hidden i had set nohidden in my vimrc and commented it out, but apparently its default. So i guess either you add it to the readme that you need to set hidden or you use some other way that is independent of hidden buffers.

yes everything works

LoricAndre commented 3 years ago

All right, I'll add it to the doc ! I don't really see why anyone wouldn't use hidden anyway, so it shouldn't be too restrictive.

LoricAndre commented 3 years ago

It's added to the doc now !

LoricAndre commented 3 years ago

Thanks for the debugging ! I'm closing the issue now.

aMOPel commented 3 years ago

Thanks for the debugging ! I'm closing the issue now.

thanks for bearing with me

basilgood commented 3 years ago

Toggle works ok but if type exit in terminal: Error executing vim.schedule lua callback: vim.lua:492: Vim(edit):E32: No file name

LoricAndre commented 3 years ago

This is due to a recent change, should be easy to fix !

basilgood commented 3 years ago

You are so fast :) Keep the great work.

LoricAndre commented 3 years ago

Should be done !

basilgood commented 3 years ago

Yes it works now.