ezprompt
ezprompt copied to clipboard
FR/RFC: mksh support
Hi,
would you be interested in support for generating a PS1 for the other big Unix shell mksh from the same webapp? Shouldn’t be to difficult, and I convert GNU bash prompts to mksh syntax in IRC all the time…
Disclaimer / Full Disclosure: I’m also the mksh upstream developer
Hey, sorry for not responding to this sooner. I've actually been meaning to refactor / add to this project for a while so sure, mksh support could be cool.
I've created a branch called mksh with basic mksh support that seems to work, though I haven't tested it extensively. The remaining work / known bugs are:
- [ ] The previews for
shell,shell version, andshell releaseare wrong. - [ ]
git statusanderror codearen't implemented. - [ ]
12hr time w/ secondsshows AM/PM in mksh but not bash.
The rest of the prompt elements and color selection should work.
Something I'm not sure of is how to handle the shell version and shell release elements in mksh. In bash they appear as 4.2 and 4.2.42. The closest analog I could find was the $KSH_VERSION environment variable, but it doesn't follow the same major.minor.patch pattern. On my laptop it's @(#)MIRBSD KSH R51 2015/07/10. Any suggestions on what parts of this string it would make sense to display?
Josh Matthews dixit:
Hey, sorry for not responding to this sooner. I've actually been meaning to refactor / add to this project for a while so sure, mksh support could be cool.
OK, thanks.
I've created a branch called
mkshwith basic mksh support that seems to work, though I haven't tested it extensively. The remaining work / known bugs are:
OK, I’ll look at that when I get the time.
- [ ]
git statusanderror codearen't implemented.
Should be easy.
- [ ]
12hr time w/ secondsshows AM/PM in mksh but not bash.
Isn’t it supposed to?
Something I'm not sure of is how to handle the
shell versionandshell releaseelements in mksh. In bash they appear as4.2and4.2.42. The closest analog I could find was the$KSH_VERSIONenvironment variable, but it doesn't follow the samemajor.minor.patchpattern. On my laptop it's@(#)MIRBSD KSH R51 2015/07/10. Any suggestions on what parts of this string it would make sense to display?
Well, the release number is the shell version, mostly, and the date could be used for shell release? I have no idea. I don’t subscribe to the concept that there should be multiple decimal dots in a number.
bye,
//mirabilos
„Cool, /usr/share/doc/mksh/examples/uhr.gz ist ja ein Grund, mksh auf jedem System zu installieren.“ -- XTaran auf der OpenRheinRuhr, ganz begeistert (EN: “[…]uhr.gz is a reason to install mksh on every system.”)