Repository navigation
fix(console): fix canvas scrollbar gutter, scroll redraw, and mobile spacing - #7280
Closed
SandipGhimire wants to merge 1 commit into
Closed
SandipGhimire wants to merge 1 commit into
SandipGhimire wants to merge 1 commit into
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
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.
Issue
term.writeln()appended\r\nafter every line and left the cursor visible on a trailing empty row, creating extra gap above the command input.measureFont()only measured"M", whose near-zero descent caused descenders (g, j, p, q, y, [, ]) to bleed across rows and not clear cleanly during scroll redraws.Terminal.resize()inghostty-weboverwrotecanvas.widthwithoutdevicePixelRatioscaling, andFitAddon's 50ms_isResizinglock dropped immediate post-layout and mobileResizeObserverre-fits.-ml-4 w-[calc(100%+2rem)]) pushed the console outside the page container past the power buttons, and missingmin-w-0/overflow-hiddenprevented the flex wrapper from shrinking when resizing down to mobile.Solution
\r\nbefore subsequentwritelncalls instead of after the last line, hide the read-only canvas cursor (cursorVisible = false), and remove bottom container padding when the command input is visible.measureTerminalFont) so rows never clip or overlap descenders.[]instead ofnullfromgetLine/getScrollbackLine, clampviewportYto[0, maxScrollback], and clear the canvas background whenever the whole-line viewport shifts.FitAddon's_isResizingguard (unlockFitResize) and preserve HiDPI canvas sizing interm.resize().w-full,min-w-0, andoverflow-hiddenon the console containers inConsole.tsxso the terminal andConsoleScrollbaralign and resize properly on mobile viewports.