ezprompt icon indicating copy to clipboard operation
ezprompt copied to clipboard

FR/RFC: mksh support

Open mirabilos opened this issue 9 years ago • 2 comments
trafficstars

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

mirabilos avatar Apr 25 '16 16:04 mirabilos

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, and shell release are wrong.
  • [ ] git status and error code aren't implemented.
  • [ ] 12hr time w/ seconds shows 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?

jmatth avatar May 27 '16 22:05 jmatth

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 mksh with 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 status and error code aren't implemented.

Should be easy.

  • [ ] 12hr time w/ seconds shows AM/PM in mksh but not bash.

Isn’t it supposed to?

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?

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.”)

mirabilos avatar May 27 '16 23:05 mirabilos