Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Print color end esc seq only when colors enabled #34

Closed
wants to merge 3 commits into from

3 participants

@hron

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.

hron added some commits
@hron hron added guard. e0f7ca0
@hron hron Print end color escape sequence only when colors are enabled.
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.
b5cbcc0
@hron hron Revert "added guard."
This reverts commit e0f7ca0.
6769091
@hron

Ooops. Sorry for the guard commit. ;)

@jeffkreeftmeijer

Hey Aleksei,

Thanks for helping out! Could you take out the two Guard-commits (e0f7ca0 and 6769091) and add a test to make sure I won't break this in a future release?

Thanks again!

-- Jeff

@jfelchner
Owner

@hron added here: 6c93377

Thanks!

@jfelchner jfelchner closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 29, 2011
  1. @hron

    added guard.

    hron authored
Commits on Aug 5, 2012
  1. @hron

    Print end color escape sequence only when colors are enabled.

    hron authored
    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.
  2. @hron

    Revert "added guard."

    hron authored
    This reverts commit e0f7ca0.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/fuubar.rb
View
2  lib/fuubar.rb
@@ -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
Something went wrong with that request. Please try again.