Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

term is always creating new instances #5

Closed
aMOPel opened this issue Apr 16, 2021 · 33 comments
Closed

term is always creating new instances #5

aMOPel opened this issue Apr 16, 2021 · 33 comments

Comments

@aMOPel
Copy link

aMOPel commented Apr 16, 2021

No description provided.

@aMOPel
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Owner

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

@aMOPel
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Owner

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Author

aMOPel commented Apr 16, 2021

ill change my $SHELL wait

@LoricAndre
Copy link
Owner

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Author

aMOPel commented Apr 16, 2021

ill change my $SHELL wait

so it is still happening with sh

@LoricAndre
Copy link
Owner

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

@aMOPel
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Owner

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Owner

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Owner

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
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Owner

Oh so you mean everything works with set hidden ?

@aMOPel
Copy link
Author

aMOPel commented Apr 16, 2021

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
Copy link
Owner

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
Copy link
Owner

It's added to the doc now !

@LoricAndre
Copy link
Owner

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

@aMOPel
Copy link
Author

aMOPel commented Apr 16, 2021

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

thanks for bearing with me

@basilgood
Copy link

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
Copy link
Owner

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

@basilgood
Copy link

You are so fast :)
Keep the great work.

LoricAndre pushed a commit that referenced this issue Apr 16, 2021
@LoricAndre
Copy link
Owner

Should be done !

@basilgood
Copy link

Yes it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants