ANSI エスケープコードとは?
ANSI エスケープコードとは、エスケープ文字で始まるバイトのシーケンスで、端末が印字可能なテキストではなくコマンドとして読み取ります。これらのコードは前景色と背景色を設定し、カーソルを移動または非表示にし、画面の一部を消去します。プログラムはこれらを出力して、色付きで動的なコマンドライン出力を生成します。
なぜ重要か
CI のログがエスケープコードを取り込んでいるのにログビューアがそれを解釈しない場合、出力は不要な角括弧のシーケンスで散らかって見えます。これを知っておくと、多くのツールが自分の出力が端末でないと検出したときに色を取り除く理由が分かります。
関連ガイド
What Is a Pseudo Terminal?A pseudo terminal is a software pair that emulates a hardware terminal, letting programs that expect a termin…
What Is a Controlling Terminal?A controlling terminal is the terminal associated with a session that delivers keyboard signals and identifie…
What Is Line Buffering?Line buffering flushes output each time a newline is written, so complete lines appear promptly while still b…