Skip to content

Instantly share code, notes, and snippets.

@lukaszx0
Created May 21, 2010 13:56
Show Gist options
  • Save lukaszx0/408864 to your computer and use it in GitHub Desktop.
Save lukaszx0/408864 to your computer and use it in GitHub Desktop.
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
def underline n; escape "4;#{n}" end
def escape n; "\033[#{n}m" if STDOUT.tty? end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment