-
-
Notifications
You must be signed in to change notification settings - Fork 826
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
Float Pane #5576
base: main
Are you sure you want to change the base?
Float Pane #5576
Conversation
9bd3c95
to
03eabc7
Compare
Nice work! Demo video looks good. |
it would be nice to have a border for this floating pane |
Updated with border. Configs: config.float_pane_padding = {
left = '10%',
right = '10%',
top = '10%',
bottom = '10%',
} config.float_pane_border = {
left_width = '0.5cell',
right_width = '0.5cell',
bottom_height = '0.25cell',
top_height = '0.25cell',
left_color = '#665c54',
right_color = '#665c54',
bottom_color = '#665c54',
top_color = '#665c54',
} |
I think this is ready to be reviewed now. |
Thanks a lot, this is the one feature I've been missing since transition from tmux to wezterm mux 🙏🏼 Tested this and it works really well, just commenting with some small issues I've seen:
A very nice action to have but definitely not required for this to be super useful on its own, is to be able to toggle the floating status of a pane so you can transition a floating pane to a split pane and vice verse. |
@Pajn I think I have the working directory issue fixed now. For the pane selection my intention was to treat the float like a overlay and turn any selection operations into no-ops and prevent the mouse from selecting a pane (I think there were some scenarios that I missed like the selection UI). I pushed an update that I think turn those into nops now. This may not be the right strategy, is there a scenario where you would want to be able to select/interact with the panes underneath the float? I think I have it updated so that closing the pane underneath the float is blocked now. Which I think will prevent the scenario where only the float is showing. I tried out being able to move the float to a split today. It seemed to work, I pushed it to this branch if you want to give it a try. I didn't want to include it in this pull request to keep the scope down. |
Wow! I was just starting to familiarize myself with the code to see if I could help but not at that speed :)
I was mostly just trying to break it to see where the limitations where. The one possible usecase I can see is to move one background pane to another tab/window if you need access to it after realizing the float pane was longer lived than you intended. However I think that's better solved by being able to transition the float pane to a split anyway. And disabling those actions when in a float definitely avoids a whole class of potential problems.
Totes! I was just excited. Thanks a lot for the branch though, will definitely start playing with it. |
i really like the work man, good stuff been wanting this feature, as im coming from zellij that has a really nice implementation of floating panes |
sure if the this should have a default binding so removing it for now)
@wez quick heads up, this is ready to be reviewed again. (No rush) New stuff.
Items from PR review
Stuff that works with floating panes
Stuff that doesn't work
|
Is there something preventing this from being merged? As I really need this feature I'm now using on multiple systems @e82eric 's version and it works perfectly... |
I've been using @e82eric's branch for almost two months now with no issues. Rebased against main a few days ago to get the screen redraw fixes and continues to be rock solid. |
Hi @e82eric. Encountering issue where the text is rendering beyond the pane when a program like htop is running in a split and moving the pane to floating window.
|
@mgpinf taking a look, quick question are you running in the multiplexer mode? |
@mgpinf nevermind the question about the multiplexer, I was able to repro it, and I think I found the issue, if you get a chance pull the latest and check if it works now. |
@e82eric Yes. It is working now :) |
@RoloEdits trying to repro the issue, any chance you can share your config? |
Sure. I am on windows as well, by the way. config.floating_pane_padding = {
left = '5%',
right = '5%',
top = '10%',
bottom = '10%',
}
config.floating_pane_border = {
left_width = '0.2cell',
right_width = '0.2cell',
bottom_height = '0.10cell',
top_height = '0.10cell',
left_color = '#cdd6f4',
right_color = '#cdd6f4',
bottom_color = '#cdd6f4',
top_color = '#cdd6f4',
} While I have your time as well, I am trying to bind CTRL+` to open a floating pane with the default shell, and then when pressed again it would toggle visibility (I imagine toggle preserves the scrollback/history). How would I go about doing this, where its created once and then subsequent presses toggle the visibility, and where there might be other floating panes active as well (If the shell pane is toggle invisible then it should be brought to the foreground among floating panes, an when toggled again I should see any other panes behind it)? Thanks! |
@RoloEdits I think I found the issue, if you get a chance can you try the latest commit? I think this is what you are looking for. { key = '`', mods = 'CTRL', action = act.ToggleFloatingPane } |
@e82eric Yep, that fixed it! And that key toggle is exactly what I was looking for. Thanks for the help and this feature, its working great. |
One thing im not sure is functioning correctly or if its a bug is what pane is shown after a floating pane is closed. For example, if I have a "persistent" floating terminal hidden, for example to edit code but want to keep the state around, and then bring up lazygit in a newly spawned floating window, when I quit out of that, the expectation is that I will be back in my text editor, the last pane I was in. But when lazygit closes, the supposed to be hidden floating terminal pane shows up and captures the cursor, needing me to hide it again. |
pane is closed. Instead it will show the regular pane below.
@RoloEdits I just pushed an update so that when you close a floating pane it will show the regular pane beneath instead of showing the next floating pane. |
Hi, I wanted to make an attempt at #270
This probably needs quite a bit of iteration (this is my first attempt at rust), but wanted to create the pull request to see if this is something you would be open to adding and to see if I am on the right track.