-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
Add floating panes #1066
Merged
Merged
Add floating panes #1066
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements #636
Notable changes
Toggling Floating Panes
Now, when pressing
ctrl+p
+w
(perhaps I'll also add an additionalALT
shortcut later), all floating panes for this tab are displayed on screen. If there are no floating panes, a new one is opened.When floating panes are visible, new panes added with
ctrl+p
+n
or withalt+n
are created as floating and placed in an appropriate place on screen. Resizing, moving and changing focus of floating panes is also possible in the same way as tiled panes are resized, moved or changed focus today.Floating panes can also be moved with the mouse by clicking and dragging their frame.
Floating / Embedding an existing pane
It is now possible to float a focused embedded pane or embed a focused floating pane by pressing
ctrl+p
+e
. This will work for all embedded panes except the first one (because there must always be at least one embedded pane).New rendering mechanism
To support rendering floating panes without impacting performance, I created a new rendering mechanism. The main difference is that changed
CharacterChunk
s are serialized into VTE byOutput
rather than by their individualPane
s. This is becauseOutput
knows about the other panes and is able to intelligently "diff" the chunks so that only their exposed parts are rendered. For more on this, see: #636There are certain cases in which
Pane
s still need to send VTE output directly (eg. ringing the notification bell, hiding the cursor, etc.) For this,Output
is able to handle "pre" and "post" vte instructions to be used accordingly.link handler is now Rc
Due to the new rendering algorithm, I made the link handler global to the screen thread and wrapped it in a reference counter so that it can be shared between panes. This allows the
Output
, now in charge of serialization, to handle OSC 8 links for multiple panes.New Tab integration tests
I added a new type of integration tests for
Tab
s (but this method can be used for anything that renders itself withOutput
). These perform a similar function to the E2E tests we have with a docker container, but are isolated to onlyTab
s. Meaning they're much faster and more reliable. Most tests for this feature are implemented in this way, except one to check that "all parts are connected" all the way through.Performance fix
While working on this feature, I discovered that our performance has slightly degraded due to some uncached row-width calculation. I added a "width_cached" method to
Row
that significantly improved things.