How do you launch terminal (mac) using c code?
-
07-12-2019 - |
Pergunta
I'm porting an app i've been working on from Linux to Mac and i'm having trouble with one specific line:
system(gnome-terminal -x sh -c \"/home/mrmartin/NetBeansProjects/Consumer/dist/Debug/GNU-Linux-x86/consumer\"");
Obviously this is because gnome-terminal is gnome linux only but i can't seem to find the Mac equivalent.
Solução
You can use open, e.g.
system("open -a Terminal.app");
or
system("open -a Terminal.app /path/to/script");
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow