With your instructions I got PS1 and ^L just like I needed! For that I thank 
you a lot.
I think this makes everything almost perfect for me. But there are a little 
things still bugging.

First, if I type ^C the current line in the terminal will be terminated and the 
new line will be prefixed with "130|" before PS1. Is that intended? - is there 
a way to turn off?

If I type ~<tab> it transforms ~ into /home/antoniv shouldn't it be 
/home/antoniv/ ? With the finishing /?
And like before is there a way to keep it ~ without transformation? This one is 
just curiosity, doesn't bug me too much.

In the end I'm enjoying mksh especially since it's so much "cleaner" than other 
monsters ;)

Thanks for it.

> Sent: Sunday, September 11, 2016 at 3:02 PM
> From: "Thorsten Glaser" <t...@mirbsd.de>
> To: "Antoni V." <anto...@gmx.com>
> Cc: miros-mksh@mirbsd.org
> Subject: Re: backslash escapes on mksh + clear
>
> Antoni V. dixit:
> 
> >>>I've just migrated to mksh, but I'm having trouble with getting the PS1 as 
> >>>I had set before.
> >>>My PS1 used to be PS1='\h@\w\$ '.
> >>
> >>Look at dot.mkshrc as shipped with the mksh distribution.
> 
> >I looked into dot.mkshrc and it really let me customize PS1. But I'm
> >still having trouble getting it to look just as I had before. The part
> >that looks especially hard is \w (that uses ~ instead of /home/user/).
> >I can't see who to do it without sed, which would be a big hack in my
> >opinion.
> 
> dot.mkshrc contains a PS1 which does *exactly* that.
> 
> The default PS1 in dot.mkshrc is the same as GNU bash’s
> '\u@\h:\w \$ ' would be, except that \w is additionally
> limited to be at most 1/3 of the screen width long.
> 
> For your prompt, you just need to change line 41 to:
>       REPLY+=${HOSTNAME%%.*}@
> 
> Also, drop the first space from line 49, I guess.
> 
> >>>But it looks that mksh doesn't accept this backslash escapes.
> 
> That’s because those are not really backslash escapes. The OpenBSD
> people analysed it, and this is a GNU bash-specific hack that
> *cannot* be parsed within the normal POSIX shell framework.
> 
> >>>Is there another way to get this behavior back to me?
> 
> Yes, see the manpage and above.
> 
> >>>Another thing I miss is the way ^L works.
> >>
> >>Esc+^L, or use “bind” to rebind it.
> >
> >Esc+^L is what I was looking for!
> 
> Yes.
> 
> >You know any way to make ^L behave this way by default?
> 
> Yes, by using the “bind” built-in utility. :þ
> 
> >I'm not sure about what's bind/rebind.
> 
> Basically, you add the line…
>       bind '^L=clear-screen'
> … at the bottom in ~/.mkshrc (after all the stuff from dot.mkshrc).
> 
> >>More answer later when I’m not on the road… or search the archives.
> 
> >Have a safe trip. We talk back when you're not on the road. Thanks.
> 
> Thank you, it was a nice but demanding trip.
> 
> bye,
> //mirabilos
> -- 
> Yay for having to rewrite other people's Bash scripts because bash
> suddenly stopped supporting the bash extensions they make use of
>       -- Tonnerre Lombard in #nosec
>

Reply via email to