______ ______ ______ ______ ______ ______ ______ __ __ _____
______ _ _ _ /%%%%%%| /%%%%%%| /%%%%%%| /%%%%%%| /%%%%%%| /%%%%%%\ /%%%%%%| /%%| /%%| /%%%%%%\
/ _____| |_| \ \ \ \ /% %| /%/ /%/ |%%| |%%| |%/ /%/ /%/ /%/%| /%/%| /% \%%%\
| | \ \ \ \ /%%%%%% %| /%%%%%%%%| /%/ |%%| |%%| /%/ /%/ /%/|%| /%/|%| /% |%%%|
| |_____ _ \ \ / / /%/ |%| _______/%| /%/ ___|%%|_ ___|%%|_ /%%/___ /%/ /%/ |%|/%/ |%| /% /%%%/
|_______| |_| \ \ /_/ /%/ |%| |%%%%%&%%%| /%%%%%%%%%%| /%%%%%%%%| /%%%%%%%%| /%%%%%%%%| /%%%%%%%%%%| /%/ |%%%/ |%| /%%%%%%%%%/
A web app written in HTML5 and vanilla JS to turn ASCII art into an easy to paste shell command.
To use, paste the art into the "Paste Art in Here" box. Then, select your shell type and whether you want a newline at the beginning of the command and press "Convert." You can then click "Copy" to copy the resulting command.
In a few words, a whole ton of experimenting with escaping.
The longer story: It started out with me fiddling with an Arduino keyboard prank where it would launch Powershell and type in some commands to make the computer do funny things. I wanted to put ASCII art in it, but I found out there was a tedious process of escaping all the characters into a command. I decided that I could automate this with a little JS. I used the .replaceAll function to escape characters that meant things to each command environment. I learned the escaping for each command interface. The hardest to write for was the Windows Command Prompt due to there being so many characters that needed to be escaped. Also, I had to chain echo commands with && to get multiple lines. Linux support was just a little annoying because I had to do some command chaining whenever there was an exclamation point in the art so that the shell didn't think it was referring to an event (Some shells support escaping the exclamation point, but in Ubuntu, that causes issues, mainly the back slash showing).
Running the output command in Linux in WSL. (Note: I am not still running Windows 7. I am just using openshell with a taskbar skin to alleviate my pain from its passing.)
Running the output command in the Windows Command Prompt (with my retro Windows Terminal Theme).
Running the output command in Windows Powershell.
It seems that iOS devices are unable to have js change their favicon.Seems to only be a problem when hosting with Apache2. Probably an issue with server configuration.- MacOS compatibility is unknown, as I neither own a Mac or know a friend who has one and is tech savy enough to test it on their Mac.
- To fix, make a pull request or confirm that the Bash mode works in Mac shell (make sure to list Mac OS version and what shell you are using.).
- Some styling does not work outsideb Webkit browsers (E.G custom scrollbars, dropdown option styling).
- Alec Lownes: Using CSS To Create a CRT
- SS64.com: How-to: Escape Characters, Delimiters and Quotes at the Windows command line.
- MDN: Mozilla Developer Documentation
- W3 Schools Documentation
- snaptortise: konami-js, Copyright (c) 2017 Snaptortoise (See MIT License)
- ASCII Art Archive: Provided a whole ton of ASCII art to test.