Skip to content

Instantly share code, notes, and snippets.

@bitcrazed
Created August 12, 2020 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitcrazed/a137f41e873494f9c6433a5d6a838935 to your computer and use it in GitHub Desktop.
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
@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