# File lib/terminfo.rb, line 95 def flush oldlevel = nil if block_given? oldlevel = Thread.current[:TermInfo_Flush_level] oldsync = @io.sync begin Thread.current[:TermInfo_Flush_level] = (oldlevel || 0) + 1 @io.sync = false yield ensure Thread.current[:TermInfo_Flush_level] = oldlevel @io.sync = oldsync end end @io.flush if oldlevel == nil nil end