Created
August 12, 2020 17:56
-
-
Save bitcrazed/a137f41e873494f9c6433a5d6a838935 to your computer and use it in GitHub Desktop.
Simple Cmd batch script containing numeric Unicode code-points and VT (color) sequences
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
chcp 65001 > nul | |
call :setESC | |
REM: Note - No easy way to escape a numeric Unicode code-point so embed emoji etc. by copy/paste or Win10 emoji keyboard (Win + .) | |
echo 🎵 Hello %ESC%[31mWorld%ESC%[0m, %ESC%[32mis%ESC%[0m %ESC%[33mit%ESC%[0m %ESC%[34mme%ESC%[0m %ESC%[35myou're%ESC%[0m %ESC%[36mlooking%ESC%[0m %ESC%[37mfor%ESC%[0m? 🎶 | |
REM `setESC` courtesy of https://github.com/mlocati in https://gist.github.com/mlocati/fdabcaeb8071d5c75a2d51712db24011#file-win10colors-cmd | |
:setESC | |
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do ( | |
set ESC=%%b | |
exit /B 0 | |
) | |
exit /B 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment