console: a bare ESC[m is a reset, and OSC sequences are consumed

Two ANSI bugs, both found by running fastfetch rather than by reading the
parser, and both invisible to anything that spells its escapes out in full.

ESC[m with no parameters means ESC[0m. ECMA-48 is explicit that an omitted
parameter takes its default and SGR's default is 0, and sgr() iterated its
parameter list -- which is empty in exactly that case, so the loop body never
ran and the reset was silently dropped.

Programs emit the bare form constantly. fastfetch writes "\x1b[32m1%\x1b[m", so
everything after the first coloured character stayed green forever. With a
background colour it is much worse: its palette swatch sets a white background
and resets, the reset did nothing, and the console went white-on-white and
stayed there -- filling the screen with white rectangles as it scrolled, which
looks like a corrupted framebuffer rather than one missing branch.

OSC sequences were not a state at all, so ESC ] fell through and the payload
printed as text: a hyperlinked path arrived as "Disk (]8;;file:///\]8;;\)".
Nothing here acts on an operating-system command -- there is no window title and
no hyperlink to follow -- but *discarding* one is not optional, because the
alternative is printing somebody's URL into the middle of their output. ESC \
ends it, and an ESC followed by anything else is handed back to the escape state
rather than eaten, so a malformed OSC does not swallow the sequence after it.

Verified by screendumping the framebuffer after two consecutive fastfetch runs:
identical output both times, near-white coverage down from most of the screen to
2% (the palette swatch's own white cell), and the disk line reading "Disk (/)".

Also installs docs/branding/Ascii/ascii_50.txt as /usr/share/schos/logo.txt --
Shift as characters, at the width that leaves room for an info block on an
80-column console. Installed from the branding directory rather than copied into
sysroot by hand, so there is one source.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
This commit is contained in:
Nexoniarz 2026-09-12 19:38:00 +02:00
commit 1754cbf1aa
8 changed files with 292 additions and 4 deletions

View file

@ -128,6 +128,25 @@ No screenshots of marks. No re-exports of re-exports: go back to the SVG.
**SVG is the source of truth for every mark.** A raster is something generated
from it, never edited.
## The mark as characters
`Ascii/ascii_{50,68,100,150}.txt` — Shift rendered in text at four widths, named
for the column count they fit in.
`make` installs the 50-column one as `/usr/share/schos/logo.txt`, because 50 is
what leaves room for an info block beside it on an 80-column console:
```sh
fastfetch --file-raw /usr/share/schos/logo.txt
```
Installed from here rather than copied into `sysroot/` by hand, so there is one
source and the build keeps them in step.
These are a *rendering* of the mark, not a second mark. If Shift changes they
are regenerated from it; they are not edited to taste, or the two drift and the
text one wins by being the one people see in a terminal.
## What is in here, and why a raster is committed
```