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:
parent
f395c39704
commit
1754cbf1aa
8 changed files with 292 additions and 4 deletions
15
Makefile
15
Makefile
|
|
@ -901,10 +901,21 @@ SCHINIT_JOBS = $(wildcard etc/schinit/*.job) etc/schinit/README
|
|||
ETC_FILES = $(wildcard etc/*)
|
||||
ETC_PLAIN = $(filter-out etc/schinit,$(ETC_FILES))
|
||||
|
||||
etc-install: $(SCHINIT_JOBS) $(ETC_PLAIN)
|
||||
@mkdir -p $(SYSROOT)/etc/schinit
|
||||
# The mark as characters, for anything that draws a logo into a terminal --
|
||||
# fastfetch takes it with --file-raw. Installed from docs/branding rather than
|
||||
# copied into sysroot by hand, so there is one source and `make` keeps them in
|
||||
# step; see docs/branding/README.md.
|
||||
#
|
||||
# The 50-column one, because that is what fits beside an info block on an
|
||||
# 80-column console. The wider renderings are in the same directory for
|
||||
# anything with more room.
|
||||
LOGO_ASCII = docs/branding/Ascii/ascii_50.txt
|
||||
|
||||
etc-install: $(SCHINIT_JOBS) $(ETC_PLAIN) $(LOGO_ASCII)
|
||||
@mkdir -p $(SYSROOT)/etc/schinit $(SYSROOT)/usr/share/schos
|
||||
@cp $(ETC_PLAIN) $(SYSROOT)/etc/
|
||||
@cp $(SCHINIT_JOBS) $(SYSROOT)/etc/schinit/
|
||||
@cp $(LOGO_ASCII) $(SYSROOT)/usr/share/schos/logo.txt
|
||||
@echo "installed $(words $(ETC_PLAIN)) /etc file(s) and $(words $(SCHINIT_JOBS)) schinit manifest(s)"
|
||||
|
||||
sysroot-install: $(addprefix $(SYSROOT)/bin/, $(CMDS)) etc-install
|
||||
|
|
|
|||
Loading…
Reference in a new issue