module TermBuf::CapabilityResolver

Overview

Settles what the terminal can do, in four stages, each overriding the one before it:

  1. a baseline of nothing at all;
  2. what the environment suggests;
  3. what the terminal says when asked directly;
  4. whatever TERMBUF_CAPS insists on.

Probing is skipped when there is nothing to probe — output that is not a terminal, or a caller that did not supply one. That is not an error: the environment heuristics stand on their own, and a program writing to a pipe still needs a capability set.

Extended Modules

Defined in:

termbuf/caps/resolver.cr

Instance Method Summary

Instance Method Detail

def resolve(env : Hash(String, String) = ENV.to_h, input : IO | Nil = nil, output : IO | Nil = nil, timeout : Time::Span = Prober::DEFAULT_TIMEOUT) : Result #

Runs the four stages. Probes only when both input and output are given.


[View source]