HeyPuter / phoenix

🔥 Puter's pure-javascript shell
https://puter.com/app/terminal
GNU Affero General Public License v3.0
87 stars 15 forks source link

human-readable outputter for binary formats #44

Open KernelDeimos opened 4 months ago

KernelDeimos commented 4 months ago

Right now commands outputting binary which cannot be rendered as test (ex: txt2img) can render the terminal unusable as reported here.

Most shells will have this same issue because byte streams are always rendered when they're not redirected. However, we can do a bit better since commands have models. For any command with a corresponding model, we can specify the output format. For any command that reports to output in binary format, if it's directly output to stdout we can render it as hex values instead.

Open to suggestions/ideas on this, especially about potential problems with the approach described above.