commit 411979bf2bce9aafe59f7449f6b5337b9e1beb68 parent b3f56d478852bb617e449e642723c9bda470e540 Author: hhvn <dev@hhvn.uk> Date: Wed, 5 Jan 2022 08:29:34 +0000 .rcrc: place missing newline handling after getting prompt info Diffstat:
M | .rcrc | | | 15 | +++++++-------- |
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/.rcrc b/.rcrc @@ -111,22 +111,21 @@ fn __prompt { # Frontend prompt function fn prompt { + __prompt_content = `''{__prompt} + __prompt_indent = `$nl{printf '%s' $__prompt_content | + awk '{gsub(/\001[^\002]*\002/, ""); print}' | + sed 's/[^ ]/ /g;s/$/ /g'} + prompt = ($__prompt_content $__prompt_indent) + # missing newline # https://www.vidarholen.net/contents/blog/?p=878 __prompt_tput setaf 14 printf '%%' - tr '\0' ' ' < /dev/zero | head -c `{tput cols} + tr '\0' ' ' < /dev/zero | head -c `{tput cols} | sed 's/.//' printf '\r' # set X11 title printf '\033]0;rc: %s\007' `{pwd} - - # prompt stuff - __prompt_content = `''{__prompt} - __prompt_indent = `$nl{printf '%s' $__prompt_content | - awk '{gsub(/\001[^\002]*\002/, ""); print}' | - sed 's/[^ ]/ /g;s/$/ /g'} - prompt = ($__prompt_content $__prompt_indent) } # Aliases