Re: [Vala] Process spawn not working when the Terminal is not opened



Hello Christian,

On Thursday, 02 May, 2013 08:37 PM, Christian Capasso wrote:
I'm having some issues using the Process_spawn command in an application
ready to be released. My problem is that, the Process_spawn command is not
working if a Terminal window is not opened.

For example, the "dd" command works fine if the application starts up with
an empty Terminal window. This results in something weird: I have to
display a Terminal window together with my application windows to get
everything to work!

This only happens, as far as I know, when a the Terminal command called by
Process_spawn requires Sudo permissions.
Are you calling sudo to run the command? A terminal is required by sudo to
ask for the password by default. Maybe this is the reason a terminal is
opened automatically. If you are indeed running sudo to run the command,
you could pass the -S option in sudo, then check the output when it is
asking for a password. This is how Anjuta do it (though with some
differences, since Anjuta use fork and exec, and the patches to use spawn
functions of GLib instead are not yet committed).


Regards,

Arnel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]