Skip to content

Commit

Permalink
fixed bug with PS1 prompt color
Browse files Browse the repository at this point in the history
  • Loading branch information
rtmigo committed Mar 5, 2021
1 parent 9e733a6 commit 7cae3d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion svet/constants.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.1"
__version__ = "0.2.2"
19 changes: 14 additions & 5 deletions svet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,25 @@ def shell(venvDir: Path, venvName: str):
raise VenvDoesNotExistError

useColor = True
YELLOW = "\e[33m"
CYAN = r"\e[36m"
NOCOLOR = r"\e[0m" #
# YELLOW = "\e[33m"
# CYAN = r"\e[36m"
# NOCOLOR = r"\e[0m" #

GREEN = "\e[32m\]"
MAGENDA = "\e[35m\]"
YELLOW = "\e[33m\]"
CYAN = r"\e[36m\]"
BLUE = r"\e[34m\]"
NOCOLOR = r"\e[0m\]" #

activatePathQuoted = quote(str(venvDir / "bin" / "activate"))

venvName = "(" + venvName + ")"

if useColor:
ps = f"\\[{CYAN}svet@{venvName}> {NOCOLOR}\\]" # fancy but buggy
ps = f"\\[{YELLOW}{venvName}{NOCOLOR}:{CYAN}\\W{NOCOLOR}$ \\]" # fancy but buggy
else:
ps = f"vep@{venvName}> "
ps = f"vep@{venvName}$ "

commands = [
f'source {activatePathQuoted}',
Expand Down

0 comments on commit 7cae3d5

Please sign in to comment.