From 323bc219238e3c4e37754a926495b9315f0c1857 Mon Sep 17 00:00:00 2001 From: Leonardo Santiago Date: Mon, 6 May 2024 22:12:03 -0300 Subject: handle term type as dumb to not complicate terminal --- users/leonardo.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/users/leonardo.nix b/users/leonardo.nix index 064fcb1..16a0141 100644 --- a/users/leonardo.nix +++ b/users/leonardo.nix @@ -32,7 +32,6 @@ enableCompletion = true; promptInit = '' - PS1="\e[0;95m\[[\h]\]\e[0m \e[0;32m\[\w\]\e[0m :: " vterm_printf() { if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ]); then # Tell tmux to pass the escape sequences through @@ -47,7 +46,17 @@ vterm_prompt_end(){ vterm_printf "51;A$(whoami)@$(hostname):$(pwd)" } - PS1=$PS1'\[$(vterm_prompt_end)\]' + case "$TERM" in + "dumb") + PS1="> " + ;; + xterm*|rxvt*|eterm*|screen*) + PS1="\e[0;95m\[[\h]\]\e[0m \e[0;32m\[\w\]\e[0m :: '\[$(vterm_prompt_end)\]'" + ;; + *) + PS1="> " + ;; + esac ''; }; fonts = { -- cgit v1.2.3