Skip to content
Justin Hileman edited this page Nov 6, 2022 · 2 revisions

🎨 Themes

PsySH supports output themes, which control prompt strings, formatter styles and colors, and compact output.

There are three built-in themes: modern, compact or classic, which can be specified directly:

'theme' => 'classic'

For more control, specify a custom theme:

'theme' => [
  'prompt' => '⟫ ',
  'bufferPrompt' => 'β‹― ',
  'replayPrompt' => '‑ ',
  'returnValue' => 'β‡’ ',
],
Option Description

compact

With the compact theme option (or the --compact command line flag), PsySH output includes less whitespace.

Default: false

prompt

The standard input prompt.

Default: "> "

bufferPrompt

The input prompt used for multi-line input continuation.

Default: ". "

replayPrompt

Output prefix indicating lines replayed from history.

Default: "- "

returnValue

Output prefix indicating the evaluated input's return value.

Default: "= "

styles

Override output formatting colors and styles.

Available colors are black, red, green, yellow, blue, magenta, cyan, white and default. Available options are bold, underscore, blink, reverse and conceal. See Theme::DEFAULT_STYLES for defaults.

Note that the exact effect of these colors and options on output depends on your terminal emulator application and settings.

If you're having a hard time seeing error messages in your terminal try:

'theme' => [
  'styles' => [
    // name => [foreground, background, [options]],
    'error' => ['black', 'red', ['bold']],
  ]
]

Default: Theme::DEFAULT_STYLES