Options
The following options are common to all API methods.
Terminal Options
columnsnumber
The column width of the captured terminal window.
rowsnumber
The row height of the captured terminal window.
tabSizenumber
Tab column width. Defaults to 8
.
cursorHiddenboolean
Cursor is hidden in the captured terminal recording or frame. Defaults to false
.
windowTitlestring
Terminal window title. Default is undefined
. See the window title section for more details.
windowIconstring | boolean
Icon to display next to the terminal window title. Can be set to a keyword string to specify a specific icon (see the window icon keywords section for a list of keywords). If set to true
, the value of windowTitle
is used. Default is undefined
.
Output Options
outputstring
The desired output format. Must be either 'svg'
, 'png'
, 'json'
, or 'yaml'
. The default is 'svg'
.
For more details on controlling the output format, please refer to the Output section of this documentation.
outputPathstring | string[]
File path or array of file paths to write output to. The type of output (SVG, PNG, JSON, or YAML) will be inferred by the file extension provided in each path (e.g., .svg
, .png
, .json
, .yaml
, or .yml
). Default is undefined
.
For more details about saving output directly to a file, please refer to the Output section of this documentation.
scaleFactornumber
The device scale factor used when rendering to png. Default is 4
.
This option is only applicable when rendering to png.
embedFontsboolean
Embed required fonts when rendering to svg, Defaults to true
. Read more about embedding fonts on the fonts page.
This option is only applicable when rendering to svg.
fontsstring[]
Array of font file paths or urls to resolve fonts from. These fonts will supplement any locally installed system fonts. Default is undefined
. Supported font formats include TTF, OTF, TTC, and WOFF2. See the supplying additional fonts section for more info.
WOFF files and compressed ZIP files or directories are not supported.
Capture Options
writeMergeThresholdnumber
Consecutive writes will be merged if they occur within this number of milliseconds of each other. Default is 20
.
endTimePaddingnumber
Milliseconds to add to the end of a captured terminal recording. Default is 500
.
cropStartDelayboolean
Remove the time difference between the start of the capture and the first write when capturing a terminal recording. Defaults to true
.
Command Options
includeCommandboolean
Include a prompt and command string at the beginning of a captured recording, if the recording data includes a command. Defaults to true
.
promptstring
The prompt prefix string to use when a command is captured. Default is '> '
.
This option is only applicable when includeCommand
is true
.
keystrokeAnimationboolean
Include a command input keystroke animation at the start of the recording if command prompt line is captured. Defaults to true
.
This option is only applicable when includeCommand
is true
.
keystrokeAnimationIntervalnumber
The delay in milliseconds between keystrokes to use when creating a command input animation. Default is 140
.
This option is only applicable when keystrokeAnimation
is true
.
Rendering Options
themeObject
Terminal theme specification object. See the themes page for more details.
fontFamilystring
Font to use for the rendered terminal output, as a CSS style list. Default is "'Monaco', 'Cascadia Code', 'Courier New'"
.
fontSizenumber
The font size of the rendered terminal output. Default is 12
.
lineHeightnumber
The line height of the rendered terminal output. Default is 1.2
.
columnWidthnumber
The aspect ratio used to determine the width of each terminal column, which will be calculated as this value times the fontSize
. If unspecified, the renderer will attempt to determine the aspect ratio of the specified fontFamily
, but if that fails will fall back to the standard value 0.6
.
Refer to the column width and line height section for more info about how fonts affect column width.
iconColumnWidthnumber
The column span of title icons in the rendered terminal output. Default is 1.6
.
borderRadiusnumber
Border radius of the rendered terminal window frame. Default is 0.25 * fontSize
.
boxShadowboolean | Object
Render a box shadow around the window frame. Default is false
. If set to true
, a default shadow effect will be rendered. Otherwise a box shadow options object can be specified to customize the shadow effect; see the window box shadow section for details on the supported customization options.
offsetXnumber
Space in pixels between the rendered terminal window frame and the left and right edges of the image. Default is 0.75 * fontSize
. See the window configuration page for details.
offsetYnumber
Space in pixels between the rendered terminal window frame and the top and bottom edges of the image. Default is 0.75 * fontSize
. See the window configuration page for details.
paddingXnumber
Amount of padding in pixels to be added to the left and right of the rendered window content box. Default is 0.25 * fontSize
. See the window configuration page for details.
paddingYnumber
Amount of padding in pixels to be added to the top and bottom of the rendered window content box. Default is 0.25 * fontSize
. See the window configuration page for details.
decorationsboolean
Render the terminal window with stoplight buttons in the top left corner. Defaults to true
. See the window configuration page for details.
insetMajornumber
Amount of inset space in pixels added to the top of the window frame when rendering it with decorations. Default is 2.5 * fontSize
. See the window configuration page for details.
This option is ignored if decorations
is false
.
insetMinornumber
Amount of inset space in pixels added to the left, right, and bottom of the window frame when rendering it with decorations. Default is 1.25 * fontSize
. See the window configuration page for details.
This option is ignored if decorations
is false
.
Debugging Options
logLevelstring
Controls how much info is logged to the console during the render process. Options are (in order of descending verbosity): 'debug'
, 'info'
, 'warn'
, 'error'
, and 'silent'
. Defaults to 'warn'
.