zitot

Why do you need to run os.execute first to have ansi colors in the windows console

Oct 29th, 2020
2,208
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.execute [[echo "Why do you need to run os.execute first to have ansi colors in the windows console?"]]
  2.  
  3. for i = 1, 107 do
  4.     print (string.format("%d\tESC[%dm test ESC[0m",i, i))
  5. end
  6.  
  7. -- This makes colored output for the windows console
  8. -- notes
  9. --  I used notepad++; using the alt code types in a single character which displays as ESC
  10. --  If you paste the code from this pastebin, colors will not work
  11. --  You need to use ALT + 0 2 7 wherever I write ESC
  12. -- some examples:
  13. -- underline: ESC[4m UNDERLINE ESC[0m
  14. -- underlined green: ESC[4;32m UNDERLINE ESC[0m
  15. -- green: ESC[32m GREEN ESC[0m
  16. -- red:   ESC[31m RED ESC[0m
RAW Paste Data