KetraTerm
API · DevelopmentAll versions

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

Link copied to clipboard
constructor()

Creates a validated snapshot with default values.

Types

Link copied to clipboard
class Builder

Mutable construction draft. Not thread-safe; build never retains this draft.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

whether an unmodified Enter key accepts an already-selected shell suggestion. Enter remains terminal input when the popup has no selection.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

initial preferred column count, at least TerminalBuffers.MIN_WIDTH.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

cursor blink period in milliseconds. A value of zero disables cursor blinking and keeps the cursor visible.

Link copied to clipboard

default cursor shape configured for the session.

Link copied to clipboard
val fallbackFonts: ImmutableList<Font>

ordered fonts used by the complex-text renderer when font cannot display a Unicode scalar cell or grapheme cluster.

Link copied to clipboard
val font: Font

primary terminal font.

Link copied to clipboard
Link copied to clipboard

packed ARGB foreground used for the default linked span while hovered and eligible for activation.

Link copied to clipboard

finite positive vertical line height scaling factor.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to 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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

resolved terminal color palette.

Link copied to clipboard

paste payload transformation applied before host-bound input emission.

Link copied to clipboard

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.

Link copied to clipboard
val rows: Int

initial preferred row count, at least one.

Link copied to clipboard
Link copied to clipboard

packed ARGB overlay used for the active search result.

Link copied to clipboard

packed ARGB overlay used for non-active search result ranges.

Link copied to clipboard

packed ARGB overlay used for visible terminal selection ranges.

Link copied to clipboard

pixels reserved between the primary-screen left margin and terminal grid when the bound session has shell-integration decorations.

Link copied to clipboard

packed ARGB color for failed-command rails.

whether failed-command output draws a vertical gutter rail.

Link copied to clipboard

failed-command rail width in pixels.

Link copied to clipboard

packed ARGB color for failed-command prompt dots.

Link copied to clipboard

packed ARGB color for normal prompt dots.

Link copied to clipboard

prompt-dot diameter in pixels.

Link copied to clipboard

whether shell-integration prompt dots are painted in the left gutter.

Link copied to clipboard

whether hosts may request shell suggestion popups automatically. Explicit requests require only smartSuggestionsEnabled.

Link copied to clipboard

master switch for all shell suggestion requests and presentation.

Link copied to clipboard
Link copied to clipboard

whether future East Asian Ambiguous codepoints should occupy two terminal cells in core width policy.

Link copied to clipboard

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.

Link copied to clipboard

packed ARGB color used for the visual bell edge pulse.

Link copied to clipboard

visual bell fade duration in milliseconds.

Link copied to clipboard

thickness of the visual bell edge bands in component pixels.

Link copied to clipboard

whether host BEL events trigger the Swing visual bell overlay.

Functions

Link copied to clipboard

Configures a fresh draft synchronously and returns a validated immutable snapshot. Exceptions propagate without changing this snapshot. Supplied services remain host-owned.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Returns a detached mutable draft. Builders are caller-confined and never retained by snapshots.