Changes
- Implement
AnyPlex Protocol.
APP allows vector, bitmap, and extensible markup objects to be embedded directly into the terminal's scrollback buffer. #902
Known Issues
- This is a test implementation of the AnyPlex protocol (PoC): no multiplexing - run in terminal only
vtm -r term; no resource management; no rescaling when changing cell size; it crashes on an empty SVG; please restart the terminal if something goes wrong.
Examples
Use vtm -r term pwsh to test on Windows (multiplexing is not implemented yet).
- Print a real SVG image (https://commons.wikimedia.org/wiki/File:Ghostscript_Tiger.svg):
"`e]app; id=tiger width=20 height=10 $(cat Ghostscript_Tiger.svg)`a" "`e]app; id=tiger flip=h`a"
- Print three colored circles:
"`e[32m`e]app;id=c2 gc=' ' width=20 height=10 <svg width='100' height='100'><circle cx='50' cy='50' r='45' fill='currentColor' stroke='red' stroke-width='5'/></svg>`a`e[31m`e]app;id=c2 gc=' '`a`e[34m`e]app;id=c2 gc=' '`a`e[m" - Clear terminal viewport:
"`e[H`e]app;id=na <svg width='1'></svg>`a" - Print image with gradients and
currentColor(question mark in a diamond):
test.svg:<svg viewBox="0 0 1000 1000" xmlns="http://www.w3.org"> <defs> <linearGradient id="green_grad" x1="0" y1="0" x2="1" y2="0"> <stop offset="0%" stop-color="#00FF00" stop-opacity="1" /> <stop offset="100%" stop-color="#00FF00" stop-opacity="0" /> </linearGradient> </defs> <path d="M 500,50 950,500 500,950 50,500 Z m -46.53619,594.80924 h 93.07238 v 93.07237 H 453.46381 Z M 430,381.07084 c 0,-50 30,-80 70,-80 40,0 70,30 70,80 0,50 -30,70 -55,95 -35,35 -45,65 -45,115 h 60 c 0,-30 10,-50 35,-75 25,-25 65,-60 65,-135 0,-80 -55,-140 -130,-140 -75,0 -130,60 -130,140 z" fill="currentColor" fill-rule="evenodd" /> <rect x="0" y="400" width="1000" height="200" fill="url(#green_grad)" /> </svg>
"`e]app;id=test width=10 height=5 $(cat test.svg)`a`n`e[35m`e]app;id=test gc=' '`a`e[m" - Show all *.svg files from
d:/temp/*.svg:$i=0; dir d:/temp/*.svg | foreach{ $id = "{0:D2}" -f $i++; write-host "$_`n`e]app;id=$id $(cat $_.FullName) `a" }
output.mp4
