From 78253e1939cd1acd7ffd9f3ab68e279cea0f5568 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Mon, 10 Jun 2019 16:48:40 +0530 Subject: [PATCH] Add WISH_AUTONEWLINE. Adds a newline is the output doesn't end with \n --- wish.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wish.sh b/wish.sh index 70dbe34..317b438 100644 --- a/wish.sh +++ b/wish.sh @@ -69,6 +69,12 @@ function wish_main() { local prev=$? PS1="" local i + if [[ $WISH_AUTONEWLINE != 0 ]]; then + echo -ne "\033[6n" ; read -s -d ';'; read -s -d R WISH_CURSOR_POSITION + if [[ $WISH_CURSOR_POSITION != "1" ]]; then + PS1="\n" + fi + fi for i in $(seq 0 $((${#WISH_PLUGINS[@]} - 1))); do wish_${WISH_PLUGINS[i]}_main $prev if [[ -v WISH_POWERLINE ]] && [[ $WISH_POWERLINE != 0 ]]; then