I have a scenario where I need to run graphical applications from other users from shell on the currently active display. In other words, I am logged in as user "A" and in Terminal I su to user "B" and need to run TextEdit.app as user "B" in user A's graphical display.

Currently if I start up (in Catalina) /Sys/System/Applications/TextEdit.app/Contents/MacOS/TextEdit I see the following in Terminal:

TextEdit[26292:293814] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted
TextEdit[26292:293831] Spell server connection invalidated
TextEdit[26292:293792] In -[NSApplication(NSQuietSafeQuit) _updateCanQuitQuietlyAndSafely], _LSSetApplicationInformationItem(NSCanQuitQuietlyAndSafely) returned error -600

And while TextEdit renders on the display I cannot get the Menubar entries for it or save files, etc.

Similar behavior happens with all apps I try such as TextMate.app. I always seem to get this error:

TextMate[26365:295425] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted

Is there any way to work around this?

  • This will only work for X11 applications – nohillside Mar 28 at 16:59
  • @nohillside I really struggled to word this correctly and while I understand DISPLAY itself will not work, I can't help but wonder if there's another mechanism for helping apps to use another user's display session / wm, etc. - whatever the appropriate terminology may be on macOS. – ylluminate Mar 28 at 17:31
  • X11 & DISPLAY don’t play any role here, macOS isn’t Linux. To rewrite the question just leave out the technical details and ask how you can run GUI applications from Terminal after using su/sudo. – nohillside Mar 28 at 17:45
  • That's not sufficient in that it doesn't explain the goal. Running apps from the shell is easy, it's running as a different user that's the challenge and therefore that rewording is not sufficient to convey it. – ylluminate Mar 29 at 18:06
  • "... after using su/sudo to switch to another user". Sure, reword in a way which makes sense for you, but as I said: X11 does not play any role in this. – nohillside Mar 29 at 18:15


X11 includes the ability to run an application on once machine with display on another.

For macOS the application and display must be the same machine.

What can be done is use screen sharing so that if you share B's screen to A. A can interact with the program running on A's machine.

There are also applications that allow you to broadcast from one machine to another - e.g. if running on B's machine, other machines can see B's interaction with the program.

  • Err, the OP is asking about using running applications as user B from Terminal while being logged in as user A, all on the same machine. – nohillside Mar 28 at 14:36
  • @nohillside is correct, this is on the same machine, just logged in as a different user in Terminal. So while perhaps not entirely dissimilar what you've said here is not the same scenario about which I've asked. – ylluminate Mar 28 at 14:53
  • Might not be the same scenario but actually is the same answer/issue – mmmmmm Mar 28 at 17:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .