Configuring Printers

This page explains how to customize printers with options
The printers in PTerm can be configured with options. All printers follow a specific scheme.

Option Scheme

To get a new printer, with custom configuration, you can fork the existing Default variant of the printer and modify the option via its WithXxx methods.
If you want to set multiple options, you can chain them:

Overwriting Default Options

You can overwrite options of the Default printers. Those options will be applied globally. This can be used to modify the style or default values.
To overwrite an option of a default printer, you can assign a forked printer to the default printer variable.


pterm.DefaultXxx = *pterm.DefaultXxx.WithXxx(option)


pterm.DefaultHeader = *pterm.DefaultHeader.WithBackgroundStyle(pterm.NewStyle(pterm.BgBlue))