-
Notifications
You must be signed in to change notification settings - Fork 0
client: Fzf based switching and sessions #20
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
Merged
Merged
Conversation
This file contains hidden or 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
The plan is to implement menus and other UI components as a popup terminal running fzf. I think this will super cool.
Now, prefix+z will toggle full-screen on the active pane. In full- screen mode, the only way to navigate to other panes it to disable the full screen mode.
We mostly want this to recover the terminal when a full-screen application crashes before cleaning up the terminal state. This happens often when running ttx inside ttx. Now, pressing prefix+shift+r will soft reset the terminal. Additionally, this improves conformance on the hyperlink test as soft reset was previously ignored, and thus didn't reset current hyperlink.
Currently, there's no way to use this functionality, but soon we'll put a menu in the popup. This commit also fixes 2 issues which caused crashes: 1. Improper cursor movement when resizing the screen. 2. Failing to delete erased panes from the pane list if that pane wasn't already active.
This is pretty cool, but because you can't rename tabs right now you can only tell the difference between tabs by the index. Next up is allowing user-provided names for tabs.
To get the desired behavior with fzf, its necessary to disable some of the UI components and pass nothing into the input pipe, and additionally use the --print-query option. The next commit will additionally force the prompt window to have a height of 3 and be top aligned, which works perfectly. Using fzf lets us avoid writing our own line editor just for certain text prompts. We should be able to use fzf for all the UI components in ttx.
Now the rename tab prompt is forced to have height 3, preventing fzf from showing any padding.
Next we can support creating, renaming, and switching between sessions. The code between tabs and sessions is fairly repetitive, but we can at least stop adding layers of indirection now. LayoutState -> Session -> Tab -> Pane
This is a temporary measure to enable running ttx in a program like dtach. Without this, all of the terminal modes ttx sets will be lost when reattaching to the session. Once ttx supports a proper client/server architecture, this logic can be removed.
The spec is clear on this, but I forgot to put the state in the ScreenState struct. This helps ensure we clear the kitty key flags when exiting the alternate screen buffer.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #20 +/- ##
==========================================
- Coverage 72.55% 66.28% -6.27%
==========================================
Files 56 62 +6
Lines 4328 4933 +605
Branches 607 698 +91
==========================================
+ Hits 3140 3270 +130
- Misses 1188 1663 +475
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Closes #19.
Check List