1

I've used electron to create desktop application on Ubuntu 14.04 Desktop and used spawn in child_process to create child process. However, when I tried to create gnome-terminal, its parent process is not electron according to pstree.

My code is:

var spawn = require("child_process").spawn;
spawn("gnome-terminal");

According to pstree,

init───lightdm───lightdm───init───gnome-terminal

Expected result:

init───lightdm───lightdm───init───bash───npm───sh───node───electron───electron───electron───gnome-terminal
Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
user6456568
  • 135
  • 3
  • 1
    Is it important to use gnome-terminal? Is it important to get the 'expected result'? Are you willing to try a work-around? – sudodus Nov 28 '18 at 05:17
  • @sudodus I think so. I'm expecting to have the terminal as the child process of electron. – user6456568 Nov 28 '18 at 08:02
  • As a workaround you can try another terminal emulator. xterm and sakura will create separate processes for each instance. Both can be installed from the repository universe (and I think xterm comes with the installation of Ubuntu 14.04 LTS). xterm is an old Unix tool. sakura is a modern tool. – sudodus Nov 28 '18 at 10:53

0 Answers0