From bb74a6de3801dd2487a937746b559d368c5acbc4 Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Thu, 9 Mar 2023 08:30:21 -0500 Subject: [PATCH] Fix venv prompt --- configs/programs/fish.nix | 10 ++++++++++ configs/programs/kitty.nix | 3 +++ 2 files changed, 13 insertions(+) diff --git a/configs/programs/fish.nix b/configs/programs/fish.nix index f0755ba..b617012 100644 --- a/configs/programs/fish.nix +++ b/configs/programs/fish.nix @@ -84,6 +84,15 @@ pkgs: { echo -n (set_color --bold red) (pwd) (set_color normal) 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 echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||') end @@ -117,6 +126,7 @@ pkgs: { echo -n (set_color white)"╭─"(set_color normal) __user_host __current_path + __venv __git_status echo -e ''' echo (set_color white)"╰─"(set_color --bold white)"\$ "(set_color normal) diff --git a/configs/programs/kitty.nix b/configs/programs/kitty.nix index e755238..3445a39 100644 --- a/configs/programs/kitty.nix +++ b/configs/programs/kitty.nix @@ -3,6 +3,9 @@ pkgs: { font.name = "Comic Mono"; font.package = pkgs.comic-mono; font.size = 13; + environment = { + VIRTUAL_ENV_DISABLE_PROMPT = "true"; + }; settings = { hide_window_decorations = true; tab_bar_style = "powerline";