Skip to content

Instantly share code, notes, and snippets.

@nik-johnson-net
nik-johnson-net / term.rb
Created March 28, 2012 18:19 — forked from eric-wood/term.rb
Write a line the full width of the terminal which updates as the terminal resizes
prev_cols = 0
puts ""
loop do
cols = `tput cols`.chomp.to_i
if prev_cols <= cols
print "\e[1A\e[2K"
print "="*prev_cols
puts "\r"
prev_cols += 1