Persistent pinch-to-zoom and mouseMode parameter#131
Open
GlassOnTin wants to merge 2 commits intoconnectbot:mainfrom
Open
Persistent pinch-to-zoom and mouseMode parameter#131GlassOnTin wants to merge 2 commits intoconnectbot:mainfrom
GlassOnTin wants to merge 2 commits intoconnectbot:mainfrom
Conversation
When the terminal grows taller (e.g. on-screen keyboard hides on mobile), libvterm calls popScrollbackLine to pull lines from the scrollback buffer back onto the screen. This keeps the cursor at the bottom of the visible area instead of leaving blank rows below. The previous stub returned 0 unconditionally, so growing the terminal always produced empty rows at the bottom. This converts the most recently pushed TerminalLine back to ScreenCell format (reversing pushScrollbackLine) and returns 1 to signal success. Tested on Android with SSH and mosh connections using bash, tmux, and zellij — the cursor now stays at the bottom after keyboard hide/show cycles.
Replace graphicsLayer zoom/pan transform with direct font size adjustment. Pinch gesture now changes calculatedFontSize (clamped 6-32 sp), which triggers terminal resize for more/fewer rows+cols. - Add onFontSizeChanged callback to persist font size on gesture end - Add mouseMode parameter to skip long-press selection and tap handling when a TUI app has mouse tracking enabled - Remove zoomScale/zoomOffset/zoomOrigin/isZooming state vars - Remove graphicsLayer transform from Canvas - Remove baseCharHeight from pointerInput key to prevent gesture cancellation during pinch - Use cumulative zoom factor for smooth, monotonic scaling
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
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
calculatedFontSizewhich triggers terminal resize (more/fewer rows+cols). AddsonFontSizeChangedcallback for persistence andmouseModeparameter to suppress selection/tap when TUI apps enable mouse tracking.Changes to Terminal composable API
New optional parameters on
Terminal()andTerminalWithAccessibility():onFontSizeChanged: ((TextUnit) -> Unit)?— called on pinch gesture end with the new font sizemouseMode: Boolean— when true, skips long-press selection and tap handling (caller handles mouse events)Pinch-to-zoom details
zoomScale,zoomOffset,zoomOrigin,isZoomingstate variablesgraphicsLayertransform from CanvasforcedSize != nullbaseCharHeightfrompointerInputkey to prevent gesture cancellation during pinchTest plan
forcedSizemode unaffected (pinch disabled)mouseMode=true→ long-press doesn't trigger selection, taps don't trigger hyperlink/focusmouseMode=false→ existing behavior unchanged