Any way to modify DISPLAY similar to how it works for X11 with the macOS display system / window manager so other users can display on active display? 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 &quot;A&quot; and in Terminal I su to user &quot;B&quot; and need to run TextEdit.app as user &quot;B&quot; 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?
No
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.