Adding Color and Cursor Control to MS-DOS Batch Files with ANSI.SYS
Learn how to load the ANSI.SYS driver in MS-DOS to add colour, cursor movement and screen clearing to batch files, with a concrete example and verification steps.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to load the ANSI.SYS driver in MS-DOS to add colour, cursor movement and screen clearing to batch files, with a concrete example and verification steps.
Goal To view log files containing ANSI SGR color codes with a pager that preserves color while protecting the terminal from unintended control sequences. Constraints & Uncertainty The less pager offers two options: -R (RAW‑CONTROL‑CHARS) which passes ANSI SGR sequences but filters other control characters, and -r (raw‑control‑chars) which passes all cont
Symptom When viewing ANSI-colored output through less -R , a search match that falls near the terminal's right margin causes the reverse-video highlight (SGR 7) to extend past the matched text onto the following wrapped line. The bleed persists until another SGR reset sequence appears in the stream. Context The -R option passes ANSI SGR sequences through whi