…R code to scan
The owner, looking at c10's menu over JetKVM: "you need to make the link for the url clickable also".
A video console cannot be clicked, so this does both halves (addendum to the TTUI brief):
1. OSC 8 hyperlinks. The Address in the header is now wrapped in
`\033]8;;<url>\033\\<url>\033]8;;\033\\`, which any modern terminal (ssh, a serial console in a
terminal app) renders as a clickable link. It is guarded on TERM: the VT reports TERM=linux and
never sees the escape, so the raw console shows the URL as plain text instead of stray characters.
2. A QR code on the physical console. `u`, or menu entry 8 "Phone", draws the web app URL with
`qrencode -t ANSIUTF8` (half blocks: this URL's 29x29 modules with margin come to 17 text rows and
fit an 80x25 screen), the URL underneath (still a link where the terminal supports it), and `a`
switches to `-t ASCII` for a console font without the block glyphs - with a note when that form
needs a taller screen than the console has. The header carries the hint: "On a phone press u".
qrencode ships with the image: libqrencode 4.1.1 (LGPL-2.1-or-later). It rides the path Dropbear and
mtools already use - mkimage.sh unpacks the Ubuntu qrencode and libqrencode4 .debs into
~/.cache/1bit-os/tools/x on first use, copies /usr/bin/qrencode to /bin/qrencode and resolves what it
links with ldd under that tree (libqrencode.so.4 from that package, plus libpng16/libz/libm/libc,
which the image already carries or takes from Ubuntu). Licences: os/licenses/qrencode/LICENSE (the
LGPL-2.1 text) and SOURCE (project, release, packaging route, why), copied into
/usr/share/licenses/1bit-os/qrencode/ with ryzenadj's; each package's own copyright file goes to
/usr/share/doc/<pkg>/copyright, exactly as Dropbear's does (they are unpacked, not dpkg-installed, so
packages.txt cannot name them); os/LICENSES.md lists them.
Proved on ryzen (no GPU, no box):
* `bash -n`, `sh -n`, `busybox sh -n`, `dash -n` clean on the menu and mkimage.sh.
* In an 80x25 tmux pane with TERM=xterm-256color and the *staged* qrencode (its own libqrencode.so.4,
nothing installed on the host): the Address line carries the OSC 8 sequence
(`\033]8;;http://192.168.50.100:13305\033\\...`), `u` draws the code, entry 8 does the same, `a`
toggles ASCII, and any key returns. With TERM=linux the same pane has **zero** OSC 8 sequences and
the URL as plain text.
* The console-drawn code is the URL: the half-block rows as captured from the pane, turned back into a
module matrix, are identical to `qrencode -t ASCII`'s matrix for the same URL (0 differing modules
of 725), and `zbarimg` on that matrix rendered as an image reads
`http://192.168.50.100:13305`.
* The mkimage staging snippet was run against the unpacked .debs: /bin/qrencode lands with
libqrencode.so.4, libpng16, libz, libm, libc, and that copy runs with LD_LIBRARY_PATH pointed at the
staged tree only.
* init.sh's restart loop is untouched; its pty proof (13 checks: crash/stty sane, Ctrl-C, q, and
#582's PS1) still passes with the new frames.
Also fixed while proving: the QR screen's hint line passed three arguments to a two-`%s` printf, which
a POSIX printf repeats - it printed a second, garbled line under the code. Caught on the pane before
it ever reached hardware.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Addendum to the TTUI brief (owner, looking at c10's menu over JetKVM): "you need to make the link for
the url clickable also". A video console cannot be clicked, so this does both halves, one PR.
1. OSC 8 hyperlinks (terminal)
The
Web appandAPIURLs in the header are wrapped in\033]8;;<url>\033\\<url>\033]8;;\033\\, which a modern terminal renders as a clickable link: ssh fromany terminal app, the serial console inside one. Guarded on
TERM: the VT reportsTERM=linuxand theescape is never sent, so the raw console shows the URL as plain text rather than stray characters.
2. A QR code (physical console)
u, or menu entry 8 Phone, draws the web app URL withqrencode -t ANSIUTF8- half blocks, two QRrows per text row in an 8x16 console font, so this URL's 29x29 modules with their margin are 17 text rows
and fit an 80x25 screen. The URL is printed under it (still a link where the terminal supports it), and
aswitches to-t ASCIIfor a console font without the block glyphs, with a note when that form needs ataller screen than the console has. The header carries the hint:
On a phone press u.How qrencode ships
libqrencode 4.1.1 (LGPL-2.1-or-later), the route Dropbear and mtools already take:
mkimage.shaddsqrencode+libqrencode4totool_debs, unpacks the two Ubuntu.debsinto~/.cache/1bit-os/tools/xon first use (the guard now also checks$tools/usr/bin/qrencode, so apopulated cache re-unpacks), copies
/usr/bin/qrencodeto/bin/qrencode, and resolves what it linkswith
lddunder that tree -libqrencode.so.4from the package pluslibpng16/libz/libm/libc,which the image already carries or takes from Ubuntu.
Licences:
os/licenses/qrencode/LICENSE(LGPL-2.1 text) andSOURCE(project, release, packaging route,why it ships), copied into
/usr/share/licenses/1bit-os/qrencode/beside ryzenadj's; each package's/usr/share/doc/<pkg>/copyrightgoes into the image exactly as Dropbear's does (they are unpacked, notdpkg-installed, so
packages.txtcannot name them);os/LICENSES.mdhas the Ubuntu-table row.Kept from main
Rebased on
73d6008; #595 (web app URL first, theup/startingprobe, the API line under it) and#582/#593/#596 are all intact - the header keeps #595's structure and wording, with both URLs wrapped
and the new hint line between them. (#595's API line still wraps at 80 columns because of its
key: grep ...tail; left as written.)Proof (ryzen; no GPU, no box)
bash -n,sh -n,busybox sh -n,dash -nclean on the menu andmkimage.sh.TERM=xterm-256color, the staged qrencode (/bin/qrencode+ its ownlibqrencode.so.4, nothing installed on the host), a local HTTP server on 13305 so the probe saysup:Web appandAPIboth carry the OSC 8 sequence (2 in the header);udraws the code, entry 8 draws it again,atoggles ASCII, any key returns to the menu;TERM=linux: zero OSC 8 sequences, URLs as plain text, QR unaffected;module matrix, are identical to
qrencode -t ASCII's matrix for the same URL (0 differing modules of725), and
zbarimgreads that matrix ashttp://192.168.50.100:13305/;.debs:/bin/qrencodepluslibqrencode.so.4,libpng16,libz,libm,libcland, and that copy runs withLD_LIBRARY_PATHat the staged treeonly (~150 KB new: qrencode + libqrencode; libpng/zlib/libc are already in the image);
init.shis untouched here; its pty proof (13 checks: SIGKILL +stty sane, Ctrl-C restart,qtothe plain shell, os: a usable console - kernel messages off the shell, a visible prompt #582's
PS1) still passes with the new frames.One bug found on the way: the QR screen's hint passed three arguments to a two-
%sprintf, which aPOSIX
printfrepeats - it printed a second, garbled hint line under the code. Caught on the pane, fixedbefore hardware.
Co-Authored-By: Claude Fable 5.1 [email protected]