diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-26 20:55:48 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-26 20:57:54 +1300 |
commit | 1e22f51087cf941311c553c7113ad2f35f7df5c9 (patch) | |
tree | aaf334408cd57807765c8deb8d0e2914d75af535 /ksh | |
parent | Mention that csmw(1df) backticks words (diff) | |
download | dotfiles-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.
Diffstat (limited to 'ksh')
-rw-r--r-- | ksh/kshrc.d/prompt.ksh | 6 |
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:' |