Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/color powershell #2511

Merged
merged 2 commits into from
Jul 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pipenv/patched/crayons.py
Original file line number Diff line number Diff line change
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