As macOS is POSIX compliant and Unix certified, why does vi redirects to vim? As I understand, vim is not POSIX compliant. So how did Apple obtained a Unix certification without having vi installed on their OS?

  • 3
    Adding to the current answer: Certified or de-jure "compliant" doesn't mean that it's actually de-facto compliant. To be UNIX™ you need to pass the TET3 testsuite (amongst other things) – think of a big unit-test. If something is not covered, it's "fine" to diverge. Eg. Apple had issues with the extended exit-code for waitid being wrongly bitmasked but still passed. To give credit where credit is due: They fixed that in the next release, iirc.
    – ljrk
    May 11 '20 at 8:34
  • 1
    Vim runs in compatible mode when it detect that it was run as vi.
    – Hauleth
    May 11 '20 at 19:13

It's actually optional.

Per the The Open Group Base Specifications Issue 7, 2018 edition in the Shells & Utilities Volume, the vi command states:

This utility shall be provided on systems that both support the User Portability Utilities option and define the POSIX2_CHAR_TERM symbol. On other systems it is optional.

That particular specification is a component of the Unix 03 product standard which is what macOS Catalina is certified for.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .