SwingSettings
Immutable Swing terminal UI settings.
Padding and fallback collections are immutable values, so copy can safely share them. Host-owned font lists are copied into immutable storage at build time. Padding reads never allocate defensive copies.
Hosts can replace this value and call io.github.ketraterm.ui.swing.api.SwingTerminal.reloadSettings to rebuild metrics and repaint. Use create for named construction and copy for immutable updates from Kotlin or Java. Builders are temporary caller-owned drafts; snapshots store validated values directly. Scrollback capacity and shell window permissions belong to core creation and host policy.
Constructors
Types
Properties
whether an unmodified Enter key accepts an already-selected shell suggestion. Enter remains terminal input when the popup has no selection.
configured alternate-screen inset in pixels. Defaults preserve primary total margins for grid sizing. Rendering centers the installed grid in the remaining space, including spare pixels after cell rounding. Explicit overrides are used as exact insets. Like other constructor properties, copy preserves explicit padding. Default padding is rebalanced when the prompt presentation mode changes, keeping default grid dimensions equal across buffers.
Converts local wheel motion to arrow keys in the alternate buffer. Defaults to true. Requires application mode 1007 (enabled by default). Application mouse reporting takes priority. Shift bypasses reporting unless XTSHIFTESCAPE requests capture. When false, wheel motion uses local viewport scrolling, allowing unhandled motion to reach the host. Primary-buffer scrolling is unaffected. Reloading a changed value clears partial wheel-to-arrow input.
initial preferred column count, at least TerminalBuffers.MIN_WIDTH.
Adjusts each cell's horizontal advance by signed logical pixels without scaling the font. Defaults to zero. Negative values condense spacing; positive values expand it. Wide characters occupy two adjusted cells. Painting and hit testing share the adjusted width. Text retains its uncondensed glyph-fitting size; existing paint-span clipping still applies. Adjacent glyphs can overlap within a run. Cell-native primitives follow the adjusted cells. At a fixed component width, condensed spacing increases the visible column count. Live sessions resize normally. Closed sessions preserve their final grid and clip columns. Component construction and settings reload validate the resolved font metrics and reject a cell width below one pixel or geometry that exceeds the integer pixel range. Rejected reloads preserve the previous settings and geometry. Settings snapshots alone cannot validate the resulting width before the component resolves its font metrics.
Copies a nonempty selection once when a local primary-button gesture completes. Defaults to false and uses the supplied clipboard handler. The gesture captures this value at press. Programmatic changes never trigger copying. Clipboard callbacks run on the EDT. Failures propagate after gesture cleanup.
cursor blink period in milliseconds. A value of zero disables cursor blinking and keeps the cursor visible.
default cursor shape configured for the session.
ordered fonts used by the complex-text renderer when font cannot display a Unicode scalar cell or grapheme cluster.
value accepted by RenderingHints.KEY_FRACTIONALMETRICS.
packed ARGB foreground used for the default linked span while hovered and eligible for activation.
finite positive vertical line height scaling factor.
Enables paste on a local middle-button press, using middleClickPasteSource. Defaults to false. Application mouse tracking takes priority; Shift restores local input unless XTSHIFTESCAPE requests capture. Uses the normal paste policy and bracketed-paste handling. Closed sessions do not read the clipboard. Without a io.github.ketraterm.ui.swing.api.SwingHostServices.middleClickPasteHandler, clipboard callbacks run on the EDT and propagate failures. A supplied hook owns clipboard access and may complete later. Changing this setting does not cancel requests already issued to a hook.
Clipboard source captured on an enabled local middle-button press. Defaults to SwingPasteSource.CLIPBOARD. The built-in path reads only this source; unavailable PRIMARY never falls back to the ordinary clipboard. A host paste hook receives the captured source and owns obtaining or declining the text. Keyboard, menu, and programmatic clipboard paste continue using the ordinary clipboard.
Allows application mouse reports from this view. Defaults to true. Disabling preserves terminal modes and permits local selection, links, and menus. Shift restores local interaction unless XTSHIFTESCAPE requests capture. A started button gesture retains its route until release. Alternate-buffer wheel input is controlled separately by alternateScreenWheelToArrowEnabled.
gesture policy for terminal-authored links. Defaults to Ctrl/Cmd activation; DIRECT allows an ordinary primary-button click. The hand cursor and active style follow eligibility, independently of visibility. Activation occurs on release without a selection drag. Detected links carry their own per-result activation policy.
prepared host styles for terminal-authored OSC 8 links. Null preserves the default dotted underline and activation color. Hosts resolve theme data before constructing this snapshot. Terminal-authored underlines retain priority over link decorations.
primary-screen visual inset around the terminal grid in pixels. Prompt-decoration and scrollbar gutters are component chrome layered outside this margin. The default keeps top padding at zero so smooth scrolling can enter through the top edge, leaves a small left margin before the prompt gutter, reserves a stable right gutter for the overlay scrollbar, and keeps a small bottom visual spacer.
resolved terminal color palette.
paste payload transformation applied before host-bound input emission.
Presentation of known prompt boundaries on the primary screen. Defaults to gutter markers. Dividers reserve one cell height per prompt in the view without changing terminal rows. The alternate screen never displays prompt decorations.
packed ARGB overlay used for the active search result.
packed ARGB overlay used for non-active search result ranges.
packed ARGB overlay used for visible terminal selection ranges.
pixels reserved between the primary-screen left margin and terminal grid when the bound session has shell-integration decorations.
packed ARGB color for failed-command rails.
whether failed-command output draws a vertical gutter rail.
failed-command rail width in pixels.
packed ARGB color for failed-command prompt dots.
packed ARGB color for normal prompt dots.
prompt-dot diameter in pixels.
whether shell-integration prompt dots are painted in the left gutter.
whether hosts may request shell suggestion popups automatically. Explicit requests require only smartSuggestionsEnabled.
master switch for all shell suggestion requests and presentation.
value accepted by RenderingHints.KEY_TEXT_ANTIALIASING.
whether future East Asian Ambiguous codepoints should occupy two terminal cells in core width policy.
whether the complex-text renderer may use installed system fonts after fallbackFonts fail (enabled by default). System font discovery is asynchronous, keeping discovery work outside painting.
packed ARGB color used for the visual bell edge pulse.
visual bell fade duration in milliseconds.
thickness of the visual bell edge bands in component pixels.
whether host BEL events trigger the Swing visual bell overlay.
Functions
Configures a fresh draft synchronously and returns a validated immutable snapshot. Exceptions propagate without changing this snapshot. Supplied services remain host-owned.
Returns a detached mutable draft. Builders are caller-confined and never retained by snapshots.