macos: shutdown on first run due to -psn_ parameter #17179

issue fanquake opened this issue on October 17, 2019
  1. fanquake commented at 6:07 PM on October 17, 2019: member

    When downloading and running Bitcoin core for the first time, after clicking through the "Are you sure you want to open. it?" screen, there's a possibility that macOS will pass an argument like -psn_0_SOME_ID to the application, which results in a shutdown as it's an invalid argument:

    v0 19 0rc1 args shutdown

    This only happens on the first run, subsequent opens will work fine, but we should filter these out, otherwise it's a poor and confusing first experience.

  2. fanquake added the label macOS on Oct 17, 2019
  3. fanquake added this to the milestone 0.19.0 on Oct 17, 2019
  4. hebasto commented at 5:26 AM on October 18, 2019: member
  5. jonasschnelli commented at 7:06 AM on October 18, 2019: contributor

    Nice catch!

    I could not find documentation about this on apples site? Anyone?

  6. hebasto commented at 7:56 AM on October 18, 2019: member
  7. laanwj commented at 8:05 AM on October 18, 2019: member

    could a native Objective-C command-line arguments parsing be useful?

    Unless absolutely necessary, please don't introduce any MacOS specific code (and definitely no Objective C…).

  8. fanquake commented at 11:58 AM on October 18, 2019: member

    The filtering used to be done by Qt here.

    #ifdef Q_OS_MAC
            } else if (strncmp(arg, "-psn_", 5) == 0) {
                // eat "-psn_xxxx" on Mac, which is passed when starting an app from Finder.
    

    Besides #17184, could a native Objective-C command-line arguments parsing be useful?

    Yea, definitely NACK.

  9. fanquake closed this on Oct 18, 2019

  10. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me