I am currently trying to open a terminal in Linux from Mathematica in which the present working directory is given by the Directory[].

My naive attempt

RunProcess[{"gnome-terminal", "--working-directory=" <> Directory[]}]

does not seem to work and returns a standard error "error: XDG_RUNTIME_DIR not set in the environment". I am aware that this might not be a Mathematica specific problem but general answers regarding the same error message did nothelp me much so far.

  • $\begingroup$ if you have xterm you may be better off to just run that (or any other plain terminal). Gnome in general seems to just make simple things difficult. $\endgroup$ – george2079 Jan 15 '18 at 17:28
  • 1
    $\begingroup$ FWIW, RunProcess[{"open", "-a", "Terminal"}] works on MacOS. $\endgroup$ – C. E. Jan 15 '18 at 17:31
  • $\begingroup$ Does RunProcess[$SystemShell, All, "gnome-terminal --working-directory=" <> Directory[]] work $\endgroup$ – Suba Thomas Jan 15 '18 at 18:19
  • $\begingroup$ @SubaThomas Unfortunately, no. It seems that the problem is really system-dependent. $\endgroup$ – Sungmin Jan 16 '18 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.