Skip to content

Commit

Permalink
Print end color escape sequence only when colors are enabled.
Browse files Browse the repository at this point in the history
Printing "\e[0m" is not a problem for major terminal emulators, but
not for Emacs' dump terminal... Progress bar is just not shown when
fuubar works inside Emacs' terminal, even when colors are disabled.

With this patch a user is able to disable colors and have progress bar
displayed in Emacs.
  • Loading branch information
hron committed Aug 5, 2012
1 parent e0f7ca0 commit b5cbcc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fuubar.rb
Expand Up @@ -58,7 +58,7 @@ def instafail
def with_color
output.print "\e[#{colors[state]}m" if color_enabled?
yield
output.print "\e[0m"
output.print "\e[0m" if color_enabled?
end

def state
Expand Down

0 comments on commit b5cbcc0

Please sign in to comment.