diff options
author | Eike Ziller <eike.ziller@qt.io> | 2023-02-07 15:34:42 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2023-02-14 15:04:02 +0000 |
commit | 5c98eaf5929ed4e2d5b56344e3aa11b7ae596647 (patch) | |
tree | 2ea789ebd20bb6f4a8b61c79126a67ed5b95f1b8 | |
parent | a069ed838e7226817dd8064a6c92272666cf252b (diff) | |
download | qt-creator-5c98eaf5929ed4e2d5b56344e3aa11b7ae596647.tar.gz |
Fix opening Terminal on macOS 13
When Qt Creator is notarized.
Using "open" results in a privacy error. A workaround is to use
osascript. Unfortunately then the terminal window does not close
automatically anymore.
Fixes: QTCREATORBUG-28683
Change-Id: I9861d7bd5100fd28b46b774fa465c970758a3a3f
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rwxr-xr-x | share/qtcreator/scripts/openTerminal.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/share/qtcreator/scripts/openTerminal.py b/share/qtcreator/scripts/openTerminal.py index 6db94bb258..c00a51c9b8 100755 --- a/share/qtcreator/scripts/openTerminal.py +++ b/share/qtcreator/scripts/openTerminal.py @@ -100,7 +100,13 @@ def main(): shell_script.write(commands) shell_script.flush() os.chmod(shell_script.name, stat.S_IXUSR | stat.S_IRUSR | stat.S_IWUSR) - subprocess.call(['/usr/bin/open', '-a', 'Terminal', shell_script.name]) + # TODO /usr/bin/open doesn't work with notarized app in macOS 13, + # use osascript instead (QTCREATORBUG-28683). + # This has the disadvantage that the Terminal windows doesn't close + # automatically anymore. + # subprocess.call(['/usr/bin/open', '-a', 'Terminal', shell_script.name]) + subprocess.call(['/usr/bin/osascript', '-e', 'tell app "Terminal" to activate']) + subprocess.call(['/usr/bin/osascript', '-e', 'tell app "Terminal" to do script "' + shell_script.name + '"']) if __name__ == "__main__": main() |