0

I try to open an app in OSX — let's say Notes for instance, I use two commands in terminal to switch to other user:

sudo -u user /Applications/Notes.app/Contents/MacOS/Notes

this opens Notes as user, I can type, click and use normally as user

If I use su

 su - user

then launch the app

/Applications/Notes.app/Contents/MacOS/Notes

It does launch the app, but the keyboard does not work; why is this? Can you pour some insight into this?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
  • Possible duplicate of [su vs sudo -s vs sudo -i vs sudo bash](https://unix.stackexchange.com/questions/35338/su-vs-sudo-s-vs-sudo-i-vs-sudo-bash) – muru Dec 26 '17 at 03:45
  • @muru, I thought so at first too, but I don't think the answer on that question explains why the keyboard wouldn't work with `su`. Maybe I missed it? – jesse_b Dec 26 '17 at 03:46
  • @Jesse_b some macOS-specific environment variable that doesn't get carried over to login shells. Does it matter which? – muru Dec 26 '17 at 03:48
  • 1
    At any rate, [help/on-topic] says: "The Unix foundation underlying OS X (but generally not frontend application questions)" ... so dupe or off-topic. – muru Dec 26 '17 at 03:50
  • Justin, can you use `su - user` to open another application and see if the keyboard works with it? – jesse_b Dec 26 '17 at 03:52

0 Answers0