Last active
March 8, 2018 22:07
-
-
Save joallard/b98408634b298d5f0bfe4f067ebbda60 to your computer and use it in GitHub Desktop.
Shell ANSI escape sequences in Ruby (iTerm title, colors)
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
# <https://en.wikipedia.org/wiki/ANSI_escape_code> | |
# iTerm: Set title to 'foo' | |
puts "\e]0;Foo\a" | |
# equiv to | |
# puts "\033]0;Foo\007" | |
# Print 'foo' in green and reset | |
puts "\e[32;mfoo\e[0m boo" | |
# <https://en.wikipedia.org/wiki/ANSI_escape_code#Colors> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment