lib/arql/multi_io.rb in arql-0.3.3 vs lib/arql/multi_io.rb in arql-0.3.5
- old
+ new
@@ -3,10 +3,17 @@
def initialize(*targets)
@targets = targets
end
def write(*args)
- @targets.each {|t| t.write(*args)}
+ @targets.each do |t|
+ if t.isatty
+ t.write(*args)
+ else
+ t.write(*(args.map { |str| str.gsub(/\e\[(\d+)m/, '')}))
+ end
+ t.flush
+ end
end
def close
@targets.each(&:close)
end