Shared utility functions for terminal rendering.
Summary
Functions
Returns the terminal display width of text.
Left-justify str to width using spaces.
Right-justify str to width using spaces.
Functions
@spec display_width(String.t()) :: non_neg_integer()
Returns the terminal display width of text.
East-Asian wide/fullwidth characters and emoji occupy 2 terminal columns; everything else occupies 1.
@spec ljust(String.t(), non_neg_integer()) :: String.t()
Left-justify str to width using spaces.
@spec rjust(String.t(), non_neg_integer()) :: String.t()
Right-justify str to width using spaces.