Skip to content
Shuanglei Tao edited this page Mar 26, 2024 · 12 revisions

ttyd has a mechanism to pass server side command-line arguments to the browser page which is called client options:

-t, --client-option     Send option to client (format: key=value), repeat to add more options

You can also do the same thing with URL query parameters, for example:

http://localhost:7681/?fontSize=24&disableLeaveAlert=true&theme={%22background%22:%20%22green%22}

Note

URL query parameters has a higher priority than server side command-line arguments.

Basic usage

  • -t rendererType=canvas: use the canvas renderer for xterm.js (default: webgl)
  • -t disableLeaveAlert=true: disable the leave page alert (#294)
  • -t disableResizeOverlay=true: disable the terminal resize overlay (#446)
  • -t disableReconnect=true: prevent the terminal from reconnecting on connection error/close (#478)
  • -t enableZmodem=true: enable ZMODEM / lrzsz file transfer support
  • -t enableTrzsz=true: enable trzsz file transfer support (#905)
  • -t enableSixel=true: enable Sixel image output support (img2sixel / lsix)
  • -t titleFixed=hello: set a fixed title for the browser window (#133)
  • -t fontSize=20: change the font size of the terminal
  • -t unicodeVersion=11: set xterm unicode support level (default: 11, use 6 to disable unicode addon)
  • -t trzszDragInitTimeout=3000: set the timeout in milliseconds for initializing drag and drop files to upload. (default: 3000) (#1238)

Advanced usage

You can use the client option to change all the settings of xterm defined in ITerminalOptions, examples:

  • -t cursorStyle=bar: set cursor style to bar
  • -t lineHeight=1.5: set line-height to 1.5
  • -t 'theme={"background": "green"}': set background color to green

to try the example options above, run:

ttyd -t cursorStyle=bar -t lineHeight=1.5 -t 'theme={"background": "green"}' bash
Clone this wiki locally