From 6174dab1392f95506b9bbcb9294168409872b3ab Mon Sep 17 00:00:00 2001 From: ls Date: Sun, 26 Jan 2025 17:40:26 +0100 Subject: [PATCH] U:prompt.sh prevent Termux usage for (can't grep /etc/passwd) --- bashrc.d/prompt.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bashrc.d/prompt.sh b/bashrc.d/prompt.sh index 64b8590..6b084cb 100644 --- a/bashrc.d/prompt.sh +++ b/bashrc.d/prompt.sh @@ -20,7 +20,10 @@ p_start() { } p_user() { - user=$(grep $USER /etc/passwd | cut -d: -f5) + if [ -z $TERMUX_VERSION ] + then + user=$(grep $USER /etc/passwd | cut -d: -f5) + fi if [ -z $user ] then echo -e "${bg_orange}${fg_noir}\u" @@ -61,5 +64,7 @@ p_input() { PROMPT_COMMAND="p_geterr" + +echo debug PS1="$(p_start)$(p_user) \$(p_path) \w \$(p_date) \$(p_err)\$(p_end)\n$(p_input) " PS2="$(p_input)"