Skip to content

Commit 6bc2935

Browse files
committed
Fix jarun#203: support env var DISABLE_PROMPT_COLOR
This reverts commit cf3137e.
1 parent f4ca2fa commit 6bc2935

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,10 @@ Please consult the manual of your terminal emulator as well as the [Wikipedia ar
395395

396396
3. Google News service is not available if the language is `dk` (Denmark), `fi` (Finland) or `is` (Iceland). Use `-l en`. Please refer to #187 for more information.
397397

398+
4. Some users have reported problems with a colored omniprompt (refer to issue [#203](https://github.com/jarun/googler/issues/203)) with iTerm2 on OS X. To force a plain omniprompt:
399+
400+
export DISABLE_PROMPT_COLOR=1
401+
398402
### Notes
399403

400404
1. Initially I raised a pull request but I could see that the last change was made 7 years earlier. In addition, there is no GitHub activity from the original author [Henri Hakkinen](https://github.com/henux) in past year. I have created this independent repo for the project with the name `googler`. I retained the original copyright information.

googler

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,8 @@ class GooglerCmd(object):
17701770
self._results_filtered = False
17711771
self._urltable = {}
17721772

1773+
self.promptcolor = True if os.getenv('DISABLE_PROMPT_COLOR') is None else False
1774+
17731775
@property
17741776
def options(self):
17751777
"""Current options."""
@@ -1905,7 +1907,7 @@ class GooglerCmd(object):
19051907
"""
19061908
colors = self.colors
19071909
message = 'googler (? for help)'
1908-
prompt = (colors.prompt + message + colors.reset + ' ') if colors else (message + ': ')
1910+
prompt = (colors.prompt + message + colors.reset + ' ') if (colors and self.promptcolor) else (message + ': ')
19091911
enter_count = 0
19101912
while True:
19111913
try:

googler.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ Overrides the default browser. Ref:
228228
.BI GOOGLER_COLORS
229229
Refer to the \fBCOLORS\fR section.
230230
.TP
231+
.BI DISABLE_PROMPT_COLOR
232+
Force a plain omniprompt if you are facing issues with colors at the prompt.
233+
.TP
231234
.BI https_proxy
232235
Refer to the \fB--proxy\fR option.
233236
.SH EXAMPLES

0 commit comments

Comments
 (0)