Terminal renderer fix + configurable padding and smaller font sizes#48
Closed
mai1015 wants to merge 2 commits into
Closed
Terminal renderer fix + configurable padding and smaller font sizes#48mai1015 wants to merge 2 commits into
mai1015 wants to merge 2 commits into
Conversation
… marks The row combiner used to give up on the entire row as soon as one span was non-combinable (wide CJK, multi-codepoint, or anything non-ASCII), forcing the whole row through the per-span path. combine_terminal_row_runs now collects maximal contiguous groups of 1:1 char-to-cell ASCII spans and merges each group into its own TerminalRowLine, returning only the genuinely non- combinable spans as leftover — so one wide cell no longer blocks the rest of the row from being shaped once. TerminalTextRun now carries one TerminalTextSegment per originating cell (byte range + column + hash). Painting non-ASCII text per cell, rather than per Rust char, keeps a cell's base character and any combining marks (e.g. "á" as a + U+0301) shaped as a single unit at the cell's column — splitting by char had been displacing the mark into the next column. ASCII text keeps the fast single-shape path; everything else iterates segments. TerminalPreparedRow.line: Option<TerminalRowLine> becomes lines: Vec<...> to carry the multiple combined lines per row. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Adds a new terminalPadding setting (0-40 px) plumbed end-to-end through AppSettings, sanitize, defaults, SettingsSummary, the settings service (set_terminal_padding), the desktop settings UI (a new select row), and terminal_config_for_settings (Edges::all(px(padding))). The static terminal_config() default drops from 10px to 0px so the user-configured value is the sole source of padding, and the desktop pane insets stop double-counting padding. Lowers the minimum terminal font size from 10 to 8 across the cycle step list, the sanitize/summary numeric_string bounds, and the desktop picker (8..=28). The mobile font step list gains 10.0 and 11.0 and the mobile remote terminal pane insets shrink from 12 to 4 so the small-screen terminal matches the tighter desktop layout. Also tightens the default terminal line-height multiplier from 1.45 to 1.2 — the prior value left oversized gaps between rows at the new smaller font sizes. Refactors the runtime terminal settings service to route numeric-string clamping through a shared set_numeric_string helper. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
dux-web
added a commit
that referenced
this pull request
Jul 6, 2026
…down to 8 Adopted from PR #48 as opt-in settings instead of changed defaults: terminalLineHeight (1.0-2.0, default 1.45) and terminalPadding (0-40px, default 10) apply live to open terminals; font size range widens 10-28 to 8-28. Co-authored-by: mai1015 <i@mai1015.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
感谢贡献!这个 PR 已经部分合入 main:
由于是 cherry-pick + 重实现而不是分支合并,GitHub 不会自动标记 merged,这里手动关闭。再次感谢! |
3 tasks
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
Two terminal-focused changes, atomically committed.
1.
fix:shape non-ASCII terminal cells per-segment to preserve combining marksThe row combiner previously gave up on the entire row as soon as one span was non-combinable (wide CJK, multi-codepoint, or anything non-ASCII), forcing the whole row through the slower per-span path.
combine_terminal_row_runsnow collects maximal contiguous groups of 1:1 char-to-cell ASCII spans and merges each group into its ownTerminalRowLine, returning only genuinely non-combinable spans as leftover. One wide cell no longer blocks the rest of the row from combining.TerminalTextRunnow carries oneTerminalTextSegmentper originating cell (byte range + column + hash). Non-ASCII text is painted per cell instead of per Rustchar, so a cell's base character and any combining marks (e.g."á"asa+U+0301) shape as a single unit at the correct column. The previous char-based split displaced combining marks into the next column.TerminalPreparedRow.line: Option<_>→lines: Vec<_>to carry multiple combined lines per row.append_text, and combining around a non-combinable span.2.
feat:configurable terminal padding and smaller font sizesterminalPaddingsetting (0-40 px), plumbed end-to-end:AppSettings, sanitize, defaults,SettingsSummary, the settings service (set_terminal_padding), desktop settings UI (new select row), andterminal_config_for_settings(Edges::all(px(padding))).terminal_config()padding default drops from 10 px → 0 px so the user setting is the sole source of truth (the desktop pane insets were already adding their own padding, this avoids double-counting).numeric_stringbounds, and the desktop picker (8..=28). Mobile gains10.0and11.0steps and its remote-pane insets shrink12 → 4to match the tighter desktop layout.set_numeric_stringhelper.Files
apps/desktop/src/terminal/{renderer,grid_version,element}.rs— renderer fixapps/desktop/runtime/src/settings/**,apps/desktop/src/app/{settings,settings_actions,terminal_state}.rs,apps/desktop/src/terminal/config.rs— padding featureapps/mobile/lib/{models/remote_models.dart, widgets/components/remote_terminal_pane.dart},apps/mobile/pubspec.lock— mobile alignmentTest plan
Notes
.omo/(local agent session state) anddocs/spec/changes/add-tailscale-transport-2026-07-05/(a proposed but unrelated tailscale transport spec).Ultraworked with Sisyphus