Fix venv prompt

This commit is contained in:
Emi Simpson 2023-03-09 08:30:21 -05:00
parent 1554e4d8fb
commit bb74a6de38
Signed by: Emi
GPG key ID: A12F2C2FFDC3D847
2 changed files with 13 additions and 0 deletions

View file

@ -84,6 +84,15 @@ pkgs: {
echo -n (set_color --bold red) (pwd) (set_color normal) echo -n (set_color --bold red) (pwd) (set_color normal)
end end
function __venv
function __prompt_name
cat $VIRTUAL_ENV/pyvenv.cfg | head -n4 | tail -n 1 | cut -b 11- | head -c -2
end
if [ $VIRTUAL_ENV ]
echo -n (set_color white) '['(__prompt_name)']' (set_color normal)
end
end
function _git_branch_name function _git_branch_name
echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||') echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||')
end end
@ -117,6 +126,7 @@ pkgs: {
echo -n (set_color white)""(set_color normal) echo -n (set_color white)""(set_color normal)
__user_host __user_host
__current_path __current_path
__venv
__git_status __git_status
echo -e ''' echo -e '''
echo (set_color white)""(set_color --bold white)"\$ "(set_color normal) echo (set_color white)""(set_color --bold white)"\$ "(set_color normal)

View file

@ -3,6 +3,9 @@ pkgs: {
font.name = "Comic Mono"; font.name = "Comic Mono";
font.package = pkgs.comic-mono; font.package = pkgs.comic-mono;
font.size = 13; font.size = 13;
environment = {
VIRTUAL_ENV_DISABLE_PROMPT = "true";
};
settings = { settings = {
hide_window_decorations = true; hide_window_decorations = true;
tab_bar_style = "powerline"; tab_bar_style = "powerline";