Is it possible to change a setting or something in order to open files in existing Mathematica instances instead of in a new instances when double clicking the file. (This is convenient since Mathematica limits the number of instances that are allowed to open based on the license.)

Using the command line a solution was proposed in https://mathematica.stackexchange.com/a/13610/45020 however that question does not go into how to achieve the same thing in through a file explorer through double clicking / open with.

This question is similar but was considered a duplicate of the question in the first link because it didn't emphasize that it was looking for a graphical interface solution and not a command line one.

I use Ubuntu 20.04 with Nemo 4.42 as my file explorer.


2 Answers 2


I created a script MathematicaSingleInstance in /usr/local/bin that refers to /usr/local/bin/Mathematica as follows:


Mathematica -sl "$@"

After making the file executable (see Properties/Permissions), Mathematica files can be set to be opened using MathematicaSingleInstance by default and this indeed opens all Mathematica files in the first opened instance.


Under Gnome (I use Pop OS), I just added the -sl flag to the Exec line in /usr/share/applications/wolfram-mathematica13.desktop and it seems to work well:

[Desktop Entry]
Name=Mathematica 13
Comment=Technical Computing System
Exec=/usr/local/Wolfram/Mathematica/13.1/Executables/Mathematica -sl --name M-13.1 %F

UPDATE: For some reason, this stopped working for me as described above. The solution I found is to save the .desktop file to this location instead: ~/.local/share/applications/. This is better as the file can be kept with your local user permissions making is easier to update for new Mathematica releases.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.