willothy / flatten.nvim

Open files and command output from wezterm, kitty, and neovim terminals in your current neovim instance
https://luarocks.org/modules/willothy/flatten.nvim
MIT License
473 stars 13 forks source link

Provide options for when Wezterm/kitty windows should nest #56

Closed ttytm closed 1 year ago

ttytm commented 1 year ago

Describe the bug

Currently, I'm pinning commit = "d92c93959e9ac52a00002d6fd64c2d2ca5dd7192", since one of the changes afterwards includes a regression that will close a neovim instance when trying to open nvim in another tab of a terminal that already has a running nvim instance. It would be necessary to open another terminal and run it to not have it closed. A fix would be superb - here and then there always comes up a use-case for terminal tabs :).

System

willothy commented 1 year ago

I'm not sure I understand what you're describing, could you provide a list of repro steps and/or a video? I'll look into it asap once I have some more info. Thanks for reporting :)

ttytm commented 1 year ago

https://github.com/willothy/flatten.nvim/assets/34311583/1664f92f-1c7c-401b-9dce-bcda0c1d0cd0

Hopefully this makes it clear, else please let me know @willothy . It shows: opeining nvim in a new kitty terminal without issues. Then I'm trying to do it in another tab but it immediately closes on me, trying this multiple times. Same for wezterm.


It doesn't happen with the mentioned commit.

I will bisect and add the exact commit for better analysis.

ttytm commented 1 year ago

Ahh, I see

    one_per = {
        kitty = true, -- Flatten all instance in the current Kitty session
        wezterm = true, -- Flatten all instance in the current Wezterm session
    },

was added.

Didn't notice this as breaking change or opt-in feature. Had to manually opt out of it.

willothy commented 1 year ago

Ah, yes I should've marked it as breaking. That's my bad, I was perhaps a bit too hasty merging that. But with that being said, ideally you'd still be able to open a new session in another window. I'm not a fan of not being able to have multiple nvim windows open, even though I like to be able to open things from other Wezterm windows sometimes, so I'll try to get this fixed in the next few days by adding some options for when wezterm/kitty windows nest. Until then, disabling the features should be good :)

ttytm commented 1 year ago

All good, sorry for the trouble and thanks for the support!

willothy commented 1 year ago

Actually I'd like to leave this open until I have a PR adding some more options, just as a sort of to-do :)

willothy commented 1 year ago

For now you should be able to customize the pipe_path function to suit your needs. Returning nil from that will allow the instance to open. Other than that, what options would be helpful? I'm not quite sure what to add for this.