Skip to content

Instantly share code, notes, and snippets.

@eric-wood
Created March 28, 2012 17:21
Show Gist options
  • Save eric-wood/2228398 to your computer and use it in GitHub Desktop.
Save eric-wood/2228398 to your computer and use it in GitHub Desktop.
Write a line the full width of the terminal which updates as the terminal resizes
prev_cols = 0
loop do
cols = `tput cols`.chomp.to_i
if prev_cols != cols
print "\e[1A\e[2K"
puts "="*cols
end
sleep 0.5
prev_cols = cols
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment