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. hebasto cross-referenced this on Oct 18, 2019 from issue util: Filter out macOS process serial number by hebasto
  6. jonasschnelli commented at 7:06 AM on October 18, 2019: contributor

    Nice catch!

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

  7. hebasto commented at 7:56 AM on October 18, 2019: member
  8. 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…).

  9. laanwj cross-referenced this on Oct 18, 2019 from issue Replace #16578 with a more specific solution by laanwj
  10. 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.

  11. fanquake closed this on Oct 18, 2019

  12. aoirint cross-referenced this on Dec 12, 2021 from issue Mac版でわかっている不具合を直す by Hiroshiba
  13. bitcoin 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-05-19 06:54 UTC