module

TermBuf::Unicode::WidthOverrides

The TERMBUF_WIDTHS escape hatch, which has the last word over whatever the terminal said when it was measured.

TERMBUF_WIDTHS=off                      # skip the probe, keep the tables
TERMBUF_WIDTHS=+ambiguous_wide          # a CJK terminal, said not measured
TERMBUF_WIDTHS=-joined_emoji,-emoji_presentation

A bare name turns a rule on, a leading - turns it off, and anything not mentioned keeps whatever was measured. off skips the measurement.

Names are the WidthPolicy rules. An unknown one is reported rather than raised on, for the same reason TERMBUF_CAPS does it: a typo in an environment variable should not stop an application from starting, and the complaint must not reach the screen the application is about to take over.

Constants

VARIABLE = "TERMBUF_WIDTHS"

The variable itself, deliberately not application specific.

Instance methods

apply(base : WidthPolicy, env : Hash(String, String) = ENV.to_h) : Result

Applies VARIABLE from env to base.

Source
apply(base : WidthPolicy, spec : String | Nil) : Result

Applies a +name,-name list to base. A nil or empty spec changes nothing.

Source
probe?(env : Hash(String, String)) : Bool

Whether env asks for the measurement to be skipped.

Source
probe?(spec : String | Nil) : Bool

Whether env asks for the measurement to be skipped.

Source

Nested types