From 1e22f51087cf941311c553c7113ad2f35f7df5c9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 26 Jan 2017 20:55:48 +1300 Subject: Fixed prompt alignment hack for ksh The manual page for mksh hints that the escaped initial character should in fact be a carriage return, not a newline. That seems to work really well. The newline variable was an empty string before this commit anyway because it was stripped by the subshell expansion. --- ksh/kshrc.d/prompt.ksh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ksh') diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh index 09c7de6e..1dcbd864 100644 --- a/ksh/kshrc.d/prompt.ksh +++ b/ksh/kshrc.d/prompt.ksh @@ -81,11 +81,11 @@ function prompt { # Play ball with ksh's way of escaping non-printing characters typeset es nl - es=$(printf '\00') - nl=$(printf '\n') + es=$(printf '\01') + cr=$(printf '\r') # String it all together - PS1="${es}${nl}${es}${format}${es}${PS1}${es}${reset}${es}"' ' + PS1="${es}${cr}${es}${format}${es}${PS1}${es}${reset}${es}"' ' PS2='> ' PS3='? ' PS4='+<$?> $LINENO:' -- cgit v1.2.3