dot

packages and services management
Log | Files | Refs | README

commit 5ff556d655464f26151f2f33522aa6a266981615
parent e4cd5dd569887c845be124f509b33ca763bcd039
Author: josuah <mail@josuah.net>
Date:   Tue,  1 Nov 2016 04:59:58 -0400

Fixed mksh's line width calculation

Diffstat:
Mbin/buffers | 2+-
Mshell/.profile | 16++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/bin/buffers b/bin/buffers @@ -190,7 +190,7 @@ main() esac # reset the screen, print reminder of current sessions - printf '\033[2J\033[2;0f\033[0m\n' + printf '\033[2J\033[300;0f\033[0m\n' abduco | tr ! / | sort -t "$TAB" -k 3 | sed 1d } diff --git a/shell/.profile b/shell/.profile @@ -29,6 +29,14 @@ ps1() # Path [ -z "${pwd##$HOME*}" ] && pwd="~${pwd#$HOME}" + # Status line + local status="$(status)" + local col="$(stty size | cut -d ' ' -f 2)" + printf '\033[s\033[2;0H\033[K' + printf '\033[%sC%s' "$(($col - ${#status}))" "$status" + printf '\033[2;0H%s %s' "$pwd" "$(git_status)" + printf '\033[u' + # Error code and actual prompt [ "$code" -eq 0 ] && color=32 || color=31 printf "\n \033[1;30m>\033[0;%sm>\033[1m>\033[0m " "$color" @@ -39,14 +47,6 @@ ps1() # Terminal name printf "\033]0;%s %s\007" "$pwd" "$git" - - # Status line - local status="$(status)" - local col="$(stty size | cut -d ' ' -f 2)" - printf '\033[s\033[0;0H\033[K' - printf '\033[%sC%s' "$(($col - ${#status}))" "$status" - printf '\033[0;0H%s %s' "$pwd" "$(git_status)" - printf '\033[u' } git_status()