akinsho / toggleterm.nvim

A neovim lua plugin to help easily manage multiple terminal windows
GNU General Public License v3.0
4.13k stars 168 forks source link

[Feature] Multiple terminals open in a container tab #260

Open fgsch opened 2 years ago

fgsch commented 2 years ago

Hi.

Is there any reason why side-by-side is not supported for tabs? If not, can I turn this into a feature request? 😄 Thank you!

akinsho commented 2 years ago

@fgsch please add details when opening an issue you've only included a single line, I have no idea what this request is asking for, but it sounds like trying to emulate the UI of a GUI editor

fgsch commented 2 years ago

@akinsho Sorry, let me clarify. The README says that opening multiple terminals side-by-side is not supported when the direction is tab. I was wondering if there is an underlying technical limitation or if this is something that could be implemented in the future. Thanks again.

akinsho commented 2 years ago

Hmm, it's not a technical limitation and could look nice, but I don't think it will be easy. How would it work if a user closed one of these tab splits, when they try to re-open it if they have to move to another tab with their normal buffer in it what should happen? Does the terminal stay locked to the containing tab or are they supposed to be reopened in any other tab if someone toggles them with the same ID

To be completely frank, there are many questions like this, and I'm definitely not looking to invest the time into it myself anytime soon. PRs welcome 🙏🏿

fgsch commented 2 years ago

That's fair. Thank you for getting back to me. I will close this for now.

akinsho commented 2 years ago

@fgsch I sort of like this idea tbh, that maybe you could open a tab and then have a bunch of terminals which are localized to that tab 🤔. I'll keep this open a little while longer, if the idea tickle the back of my mind long enough I might try and implement it. Otherwise I'll close this out if I come back and don't think it'll work

akinsho commented 2 years ago

Note for a possible future self or contributor.

I'm thinking that each terminal could store a tab number in its state, not sure if this would work if nvim was closed and a session was restarted later, would the tab number change.

If a terminal has a tab number then it should act as hidden unless that tab is in view so that a user can't open a tab local terminal outside the host tab (they should just use a regular toggleterm for that, maybe down the line they can be detachable, but that's way too much complexity to start with)

You should be able to toggle the parent tab, which opens with all its children and handle child tabs within it, but all actions are localized to the tab that's a hard rule otherwise this will devolve into chaos since managing what goes where is already a pain.

erlangparasu commented 1 month ago

https://github.com/akinsho/toggleterm.nvim/issues/593