feat(window): add configurable default cursor_style#72
Open
roramirez wants to merge 1 commit into
Open
Conversation
Introduce a window.cursor_style config option (block | beam | underline) that seeds the initial DECSCUSR cursor shape and is restored on reset and on `CSI 0 SP q`. Grid gains a default_cursor_shape field, the parser resets to it on param 0, and the config panel exposes a Select field whose cycling no longer fires a spurious theme preview.
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
Adds a
window.cursor_styleconfig option that sets the default cursor shape (block,beam, orunderline). The value seeds the initial DECSCUSR cursor shape for every new pane and is restored whenever the terminal resets — full reset (RIS), entering the alternate screen, andCSI 0 SP q("reset cursor to default"). Programs can still override the live shape via DECSCUSR (CSI 1..6 SP q) as before.Changes
config: newWindowConfig.cursor_style: String(serde default"block"); added toassets/config.toml, README, and SPEC.terminal/grid: newGrid.default_cursor_shapefield; reset sites now restore it instead of hardcodingBlock; added reusablecursor_shape_from_str()helper (case-insensitive, warns and falls back toBlockon unknown input).terminal/parser:CSI 0 SP qnow resets to the grid's configured default shape;1..6unchanged.pane_ops: seeds bothdefault_cursor_shapeandcursor_shapefrom the config when spawning a pane.config/tui_config: new "Cursor Style" Select field; generalizedcycle_selectso only the Theme field emits a livePreviewTheme(other Select fields no longer fire a spurious theme preview).CSI 0 SP qreset, grid reset/alt-screen restore-to-default,cursor_shape_from_strvariants, config round-trip, and tui_config field-count/index/round-trip/cycle assertions.[window]block.How to test
cargo test— all pass (parser, grid, config, tui_config coverage).cargo clippy --locked -- -D warnings— clean.cursor_style = "beam"under[window]in~/.config/mmterm/config.toml, launch mmterm, confirm the cursor starts as a beam; runprintf '\e[2 q'(block) thenprintf '\e[0 q'and confirm it returns to a beam.