module Console::Terminal

def self.for(io)

def self.for(io)
	if io.isatty
		XTerm.new(io)
	else
		Text.new(io)
	end
end

def self.start_at!(environment = ENV)

Exports CONSOLE_START which can be used to synchronize the start times of all child processes when they log using delta time.
def self.start_at!(environment = ENV)
	if time_string = environment[CONSOLE_START_AT]
		start_at = Time.parse(time_string) rescue nil
	end
	
	unless start_at
		start_at = Time.now
		environment[CONSOLE_START_AT] = start_at.to_s
	end
	
	return start_at
end