❯_termy
DeveloperWeb terminal

Web terminal options

Every option for @termysh/web, with defaults.

Pass options to the constructor, or change them later. Every option applies at runtime: font and padding changes re-measure the cell and re-fit the grid, and everything else repaints.

const term = new Terminal({ fontSize: 14, cursorStyle: 'bar' })
term.setOptions({ fontSize: 16, theme: 'nord' })
term.setOption('cursorBlink', true)

Font

OptionDefaultDescription
fontFamilyJetBrains Mono, SF Mono, Menlo, ... monospaceCSS font family
fontSize14CSS pixels
fontWeight'normal'Weight for regular text
fontWeightBold'bold'Weight for bold text
lineHeight1Multiplier of the font's natural line height
letterSpacing0Extra CSS pixels between cells

The cell size is re-measured when web fonts finish loading and when the window moves to a display with a different pixel ratio.

Colors

OptionDefaultDescription
theme'termy'Bundled theme id, theme object, or { extends, ...overrides }. See Themes
drawBoldTextInBrightColorstrueBold text in ANSI colors 0-7 uses colors 8-15
minimumContrastRatio1WCAG contrast ratio enforced for text, from 1 (off) to 21
allowTransparencyfalseLet the page show through cells with the default background

Cursor

OptionDefaultDescription
cursorStyle'block''block', 'bar' or 'underline'
cursorBlinkfalseBlink while focused
cursorWidth1Bar cursor width in CSS pixels
cursorInactiveStyle'outline'Cursor while unfocused: 'outline', 'block', 'bar', 'underline' or 'none'

Applications can still change the cursor shape with DECSCUSR; cursorStyle is the shape it returns to after a reset.

Layout

OptionDefaultDescription
cols, rows80, 24Initial grid size; autoFit replaces it once the terminal is open
autoFittrueFollow the container's size
padding0Inner padding in CSS pixels
scrollback1000Lines kept in history
scrollbartrueShow the overlay scrollbar on hover
devicePixelRatiowindow.devicePixelRatioOverride the render scale

Rendering

OptionDefaultDescription
customGlyphstrueDraw box drawing, block elements, sextants and Braille with Termy's pixel-exact geometry instead of the font
imagestrueRender kitty graphics protocol images

Scrolling

OptionDefaultDescription
scrollSensitivity1Wheel multiplier
fastScrollSensitivity5Wheel multiplier while fastScrollModifier is held
fastScrollModifier'alt''alt', 'ctrl', 'shift' or 'none'
alternateScrolltrueIn full-screen apps without mouse tracking, the wheel sends arrow keys
scrollOnUserInputtrueJump to the bottom when the user types

Input

OptionDefaultDescription
macOptionIsMetafalseOn macOS, Option acts as Alt instead of composing characters
macOptionClickForcesSelectionfalseOn macOS, Option+click selects text even when the app tracks the mouse
rightClickSelectsWordfalseRight-click selects the word under the pointer
altClickMovesCursortrueAlt+click on the prompt line moves the cursor there
disableStdinfalseIgnore all user input
ignoreBracketedPasteModefalseNever wrap pastes in bracketed paste markers
convertEolfalseTreat \n written to the terminal as \r\n

Hold Shift to select text while an application tracks the mouse. On macOS, Cmd+C and Cmd+V copy and paste; elsewhere use Ctrl+Shift+C and Ctrl+Shift+V.

OptionDefaultDescription
wordSeparator()[]{}',"` and spaceCharacters that end a double-click word selection
copyOnSelectfalseCopy to the clipboard when a selection finishes
linkHandlerOpens links in a new tab{ activate, hover?, leave?, allowNonHttpProtocols? }, or null to disable links
linkDetectiontrueDetect plain-text URLs in addition to OSC 8 hyperlinks

Only http, https and mailto links are activated unless the handler sets allowNonHttpProtocols.

Integration

OptionDefaultDescription
allowClipboardWritefalseLet OSC 52 write the system clipboard. onClipboard fires either way
bellStyle'none''visual' flashes the terminal on BEL
screenReaderModefalseMirror output into an aria-live region
wasmnext to @termysh/coreWhere to load termy.wasm from

On this page