diff options
| author | Jim | 2018-03-27 12:23:08 -0700 |
|---|---|---|
| committer | Jim Fehrle | 2018-07-23 08:25:10 -0700 |
| commit | 496d9d4007f59e6114dae9a94ee5a39d241484cf (patch) | |
| tree | 3f1972c21d467b20e9b853d87b0f5651d769c9f9 /clib/terminal.mli | |
| parent | 32415df7e24d4d79a00fae95a5f619980b006c61 (diff) | |
Generate more compact escape sequences by
a) not explicitly setting the default value and
b) not repeating attributes that are already set.
Example (omitting escape character):
Old: E : [92;49;22;23;24;27mev[39;49;22;23;24;27m [39;49;22;23;24;27mn[39;49;22;23;24;27m
New: E : [92mev[0m n
(92 is bright green, the other codes set default attributes).
Diffstat (limited to 'clib/terminal.mli')
| -rw-r--r-- | clib/terminal.mli | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clib/terminal.mli b/clib/terminal.mli index dbf8d4640c..bc30b0016f 100644 --- a/clib/terminal.mli +++ b/clib/terminal.mli @@ -51,6 +51,9 @@ val make : ?fg_color:color -> ?bg_color:color -> val merge : style -> style -> style (** [merge s1 s2] returns [s1] with all defined values of [s2] overwritten. *) +val diff : style -> style -> style +(** [diff s1 s2] returns the differences between [s1] and [s2]. *) + val repr : style -> int list (** Generate the ANSI code representing the given style. *) @@ -60,6 +63,9 @@ val eval : style -> string val reset : string (** This escape sequence resets all attributes. *) +val reset_style : style +(** The default style *) + val has_style : Unix.file_descr -> bool (** Whether an output file descriptor handles styles. Very heuristic, only checks it is a terminal. *) |
