Skip to content

Instantly share code, notes, and snippets.

@joekarma
Created August 13, 2016 06:22
Show Gist options
  • Save joekarma/2b1decb25e7a9aa1dff077df996134c9 to your computer and use it in GitHub Desktop.
Save joekarma/2b1decb25e7a9aa1dff077df996134c9 to your computer and use it in GitHub Desktop.
iTerm.app can display images, including gifs. Cool!
%w(open-uri base64).each { |lib| require lib }
# iTerm rocks!
img_url = "http://i.imgur.com/y9Rhu9i.gif"
if ENV["TERM_PROGRAM"] == "iTerm.app" # yay!
puts "\e]1337;File=inline=1:" + Base64.encode64(open(img_url).read) + "\a\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment