From e507d6e0c73bef06385da3bc457c72a86e2e8100 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 26 Apr 2021 18:17:12 +0300 Subject: [PATCH] Feat(bash_prompt): Cut dirs to 20% of the term width --- admin/prog/bash_prompt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/admin/prog/bash_prompt b/admin/prog/bash_prompt index 7ef5fc9..8c3a9fe 100644 --- a/admin/prog/bash_prompt +++ b/admin/prog/bash_prompt @@ -6,6 +6,10 @@ cgmem_which_prompt() { fi } +# Cut directories to 20% of the terminal width; add space for 3 dots +_DIR_LENGTH=`awk "END { print int(0.2 * $COLUMNS) }"