lib/hu/deploy.rb in hu-1.3.18 vs lib/hu/deploy.rb in hu-1.3.19
- old
+ new
@@ -327,11 +327,11 @@
end
end
def show_pipeline_status(pipeline_name, stag_app_name, prod_app_name, release_tag, clear = true)
table = TTY::Table.new header: %w(location commit tag app_last_modified app_last_modified_by dynos# state)
- busy 'loading', :classic
+ busy '', :classic
ts = []
tpl_row = ['?', '', '', '', '', '', '']
revs = ThreadSafe::Hash.new
[[0, stag_app_name], [1, prod_app_name]].each do |idx, app_name|
@@ -482,14 +482,15 @@
if opts[:stream]
puts "\n> ".color(:green) + line.color(:black).bright
PTY.spawn(line) do |r, _w, pid|
@tspin ||= Thread.new do
@minispin_last_char = Time.now
+ @minispin_disable = false
i = 0
loop do
break if @minispin_last_char == :end
- if 0.23 > Time.now - @minispin_last_char
+ if 0.23 > Time.now - @minispin_last_char || @minispin_disable
sleep 0.1
next
end
@spinlock.synchronize do
print "\e[?25l"
@@ -508,9 +509,13 @@
until r.eof?
c = r.getc
@spinlock.synchronize do
print c
@minispin_last_char = Time.now
+ c = c.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '') # barf.
+ # hold on when we are (likely) inside an escape sequence
+ @minispin_disable = true if c == 27
+ @minispin_disable = false if c =~ /[A-Za-z]/
end
end
rescue Errno::EIO
# Linux raises EIO on EOF, cf.
# https://github.com/ruby/ruby/blob/57fb2199059cb55b632d093c2e64c8a3c60acfbb/ext/pty/pty.c#L519