aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-26 20:55:48 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-26 20:57:54 +1300
commit1e22f51087cf941311c553c7113ad2f35f7df5c9 (patch)
treeaaf334408cd57807765c8deb8d0e2914d75af535
parentMention that csmw(1df) backticks words (diff)
downloaddotfiles-1e22f51087cf941311c553c7113ad2f35f7df5c9.tar.gz
dotfiles-1e22f51087cf941311c553c7113ad2f35f7df5c9.zip
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.
-rw-r--r--ksh/kshrc.d/prompt.ksh6
1 files changed, 3 insertions, 3 deletions
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:'