pub enum TerminfoResolution {
    Dynamic,
    None,
    Static(String),
}
Expand description

Defines terminfo database resolution semantics.

Python links against libraries like readline, libedit, and ncurses which need to utilize a terminfo database (a set of files defining terminals and their capabilities) in order to work properly.

The absolute path to the terminfo database is typically compiled into these libraries at build time. If the compiled path on the building machine doesn’t match the path on the runtime machine, these libraries cannot find the terminfo database and terminal interactions won’t work correctly because these libraries don’t know how to resolve terminal features. This can result in quirks like the backspace key not working in prompts.

The pyembed Rust crate is able to point libraries at a terminfo database at runtime, overriding the compiled-in default path. This enum is used to control that behavior.

Serialization type: string.

Variants§

§

Dynamic

Resolve terminfo database using appropriate behavior for current OS.

We will look for the terminfo database in paths that are common for the current OS / distribution. The terminfo database is present in most systems (except the most barebones containers or sandboxes) and this method is usually successfully in locating the terminfo database.

Serialized value: dynamic

§

None

Do not attempt to resolve the terminfo database. Basically a no-op.

This is what should be used for applications that don’t interact with the terminal. Using this option will prevent some I/O syscalls that would be incurred by dynamic.

Serialized value: none

§

Static(String)

Use a specified string as the TERMINFO_DIRS value.

Serialized value: static:<path>

e.g. static:/usr/share/terminfo.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.