-
-
Notifications
You must be signed in to change notification settings - Fork 770
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 |
@e82eric Thank you for taking your time to implement this.
I'm using Helix as my IDE with the help of WezTerm and other CLI tools (lazygit, tig, fzf, gh, ...). For example, I've set up key bindings to run my code in the bottom pane, or connect to a database in the right pane using Thanks, |
@quantonganh right now it has a default of CTRL|ALT|SHIFT(P) for creating the float pane, and can be closed using the normal binding for CloseCurrentPane. It can be updated in the config with something like this.
Does that help or am I misunderstanding the problem? Are you looking for something like being able to hide the floating pane instead of closing it when switching between the floating pane and the one beneath it? |
Exactly! For example: while coding, I might want to check something in the database, I can bind a key to send I realized that to achieve this, we might need to add additional values, such as |
@quantonganh if you get a chance can you try the latest commit. I made an attempt at it and wanted to see if you notice anything weird and if it matches what you were looking for, I think being able to hide the float may make more sense ux wise (I can now just hide the floating pane if someone clicks outside of it, etc). ctrl+shift+e is the default for ToggleFloatingPane |
Do you expect to be able to have more than one floating pane at a time? My use case would be to have short lived panes for interactive use, eg to implement extracto like functionality. I was wondering if long lived pane and short lived ones could co-exist |
@e82eric It's working fine now and I can use Ctrl+Shift+E to toggle the floating pane. Thank you! Regarding the My workflow would be something like this:
To support this, we'd also need to enable What do you think? |
@quantonganh have been trying to get multiple floating panes working and it has taken a lot longer than expected. For the cli list, it is probably going to take some iteration to get the data model right. The float floating panes are in their own storage outside of the regular panes which are a binary tree and the floating panes are a regular list. Would it work in your use case if cli list just had the clients in the list but not an indication of it is a floating pane or not and then separate command for list-floating-panes? Was thinking it would be useful to have a sperate command with floating pane specific information like what index the pane is so you toggle floating panes by index ex leader 1 toggles lazygit and leader 2 toggles htop |
@e82eric I don't currently need multiple floating panes, but I do find the feature useful. That was the question from @aleksandersumowski.
In my case, that's fine. But I'm not sure if we should have a separate command for listing floating panes. @wez might have more thoughts on this. |
@quantonganh That makes sense. I will try to add the is_floating property and see why activate-pane isn't working. It looks like Zellij will create the floating pane if one doesn't exist when you call toggle-floating-pane, if this did the same would it simplify the workflow at all? |
Note if the floating pane is hidden it won't show if the terminal window isn't focused (it will aprear when the terminal window gets focus), I think this matches the behavior of splits but is more noticeable with the floating pane becoming visible.
@quantonganh I just pushed the changes for the is_floating property and active-pane. If you get a chance could you try it out? |
@e82eric I've pulled your latest commits and tested it, but there seems to be an issue with listing panes:
Additionally, I'm unable to switch between the normal and floating panes using |
@quantonganh can you try to restart wezterm-mux-server, think that error happens when the mux server is still running on the previous version that doesn't know to send the new is_floating property. |
@e82eric The issue still persists when starting
Please note that, in some cases, the user might start |
@quantonganh I bumped the codec version, can you try a clean and build, make sure there aren't any running wez* processes and try again? |
the terminal window is not focused.
@e82eric Thank you! The listing of panes and switching between the floating pane and the pane beneath it are working as expected. However, it seems the
|
@quantonganh just pushed a fix. |
@e82eric It's ok now:
However, for some reasons, |
floating pane is active)
@quantonganh just pushed fix for activate-pane --pane-id 0 |
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.