Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSAScript launch commands in OS X .dmg can behave incorrectly if user has a Parallels VM with a terminal open #14427

Closed
dljsjr opened this issue Dec 16, 2015 · 4 comments
Labels
system:mac Affects only macOS

Comments

@dljsjr
Copy link

dljsjr commented Dec 16, 2015

This is a weird edge case bug and probably not worth spending a lot of cycles on, but I figured I'd report it anyway.

The current mechanism for launching the Julia REPL uses an OSAScript command (as seen here: https://github.com/JuliaLang/julia/blob/ac8f4f1ebc2bd0ccf0840cdee27830becbcf39a7/contrib/mac/app/script) to launch Terminal.app

If a user is running Parallels, either in normal mode or Coherence mode, and there is a virtual machine running that just so happens to have an app called "Terminal" running, then the commands that reference Terminal.app by name may inadvertently pick up on the VM's "terminal" app due to Parallels exposing apps running on the VM to the host OS for ease-of-use.

The bare minimum for showing that Parallels is what is responding to the OSAScript actions instead of system Terminal.app is to launch an Ubuntu VM in Parallels and use the stock Terminal application in Ubuntu. For added drama, disable Coherence but use OS X's full-screen mode or put the VM window in a different Space/Desktop. Then run the following simple AppleScript:

tell application "Terminal"
    activate
end tell

Your Desktop/Space will swap to the virtual machine and the virtualized terminal will gain focus.

Environment:

  • Host OS: OS X 10.11.2 build 15C50.
  • Guest OS: Ubuntu 14.04, stock Terminal application
  • Parallels: Parallels Desktop 11 for Mac, Business Edition version 11.1.1 build 32312

Steps to reproduce:

  1. Download Mac OS X Julia .dmg from https://s3.amazonaws.com/julialang/bin/osx/x64/0.4/julia-0.4.2-osx10.7+.dmg
  2. Copy Julia-0.4.2.app to /Applications
  3. Make sure that the OS X Terminal.app is not running
  4. Create an Ubuntu 14.04 VM in Parallels
  5. Make sure "Share Linux applications with Mac" is enabled in that particular VM's Options (this is the default)
  6. Launch the Ubuntu virtual machine
  7. Launch the stock Ubuntu Terminal application
  8. Double-click Julia-0.4.2.app

Expected results:
Terminal.app launches with the Julia REPL configured and running in OS X Terminal.app

Actual results:
Terminal.app is not launched, Terminal in the virtual machine is given focus.

@tkelman tkelman added the system:mac Affects only macOS label Dec 16, 2015
@cormullion
Copy link
Contributor

The script could target the Terminal.app application more precisely using something like this:

tell application id "com.apple.terminal"
    activate 
    ...
end tell

Would this avoid using the ambiguous "Terminal"?

I use iTerm rather than Terminal, so I don't use the Julia app anyway...

@ViralBShah
Copy link
Member

I simplified the script a fair bit recently. I can try this out and update accordingly. Seems like it should solve this one. @dljsjr Would this fix your issue?

@dljsjr
Copy link
Author

dljsjr commented Jan 12, 2016

@ViralBShah Using the bundle ID seems to work well when I test it locally.

simonbyrne added a commit that referenced this issue Sep 15, 2016
@simonbyrne
Copy link
Contributor

simonbyrne commented Sep 28, 2016

Fixed by #18522, please reopen if this is not the case.

tkelman pushed a commit that referenced this issue Feb 22, 2017
(cherry picked from commit 329e7e1)
ref #18522

include fix for #14427

(cherry picked from commit 259e174)

expand README

(cherry picked from commit 399710e)

remove use of sudo from OS X app makefile

(cherry picked from commit 55fa673)

add recommended Info.plist keys

(cherry picked from commit aeadb11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:mac Affects only macOS
Projects
None yet
Development

No branches or pull requests

5 participants