Terminal Database

import chafa

database  = chafa.TermDb()
term_info = database.detect()

TermDb

A TermDb contains information on terminals, and can be used to obtain a suitable TermInfo for a terminal environment.

class chafa.TermDb(no_defaults: bool = False)
Parameters:

no_defaults (bool) – If True, the class will be initialised blank instead of with the default global database.

copy()
Return type:

TermDb

Returns a new TermDb which is a copy of this one.

detect()
Return type:

TermInfo

Builds a new TermInfo with capabilities implied by the system environment variables (principally the TERM variable, but also others).

get_fallback_info()
Return type:

TermInfo

Builds a new TermInfo with fallback control sequences. This can be used with unknown but presumably modern terminals, or to supplement missing capabilities in a detected terminal.