Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2511 from pypa/feature/color-powershell
Feature/color powershell
  • Loading branch information
kennethreitz committed Jul 4, 2018
2 parents 1780e0b + e037967 commit 6a2bdc9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pipenv/patched/crayons.py
Expand Up @@ -34,12 +34,22 @@
COLORS = __all__[:-2]

is_ipython = "get_ipython" in dir()

if (
os.environ.get("CMDER_ROOT")
or os.environ.get("VSCODE_PID")
or os.environ.get("TERM_PROGRAM") == "Hyper"
):
is_native_powershell = False
else:
is_native_powershell = True

try:
is_powershell = "powershell" in shellingham.detect_shell()[0]
except shellingham.ShellDetectionFailure:
is_powershell = False

if is_ipython or is_powershell:
if is_ipython or (is_powershell and is_native_powershell):
"""when ipython is fired lot of variables like _oh, etc are used.
There are so many ways to find current python interpreter is ipython.
get_ipython is easiest is most appealing for readers to understand.
Expand Down

0 comments on commit 6a2bdc9

Please sign in to comment.