wxExecute invoking window in Windows, not so in Linux

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
p_lu
Earned a small fee
Earned a small fee
Posts: 17
Joined: Thu Oct 25, 2018 2:04 pm

wxExecute invoking window in Windows, not so in Linux

Postby p_lu » Mon Jan 07, 2019 8:17 pm

Hi,

From Windows (10), when I invoke wxExecute from a (Codeblocks) wxFrame app,
specifying a shell program (in this case Cygwin Bash), the framework opens a
shell window and executes the script within it. In (Debian/Raspian) Linux, however,
the framework processes the shell program within the window that invoked the
app. This probably has to do with the "local environment" behavior.

Is there a way I can get wxExecute to open a shell window in the Linux environment,
in the same way that Windows(10) does it? In particular, I would probably define
the SH (as below for the __linux__ case) to invoke something else that invokes /bin/sh
in turn?

Thanks for all help in advance.


=== For instance, this is the code I have...

#ifdef __linux__
#define SH "/bin/sh -c \'"
#else // Windows
#define SH "c:\\cygwin64\\bin\\sh -c \'"
#endif

...

string some_command = "/path_to_script";
string cmd = SH + some_command + "\'";
wxExecute(cmd);

p_lu
Earned a small fee
Earned a small fee
Posts: 17
Joined: Thu Oct 25, 2018 2:04 pm

Re: wxExecute invoking window in Windows, not so in Linux

Postby p_lu » Mon Jan 07, 2019 8:19 pm

I think one option might be xterm (or Terminal). Any better or more fitting
method, more parallel to the Windows case?

Thanks.

p_lu
Earned a small fee
Earned a small fee
Posts: 17
Joined: Thu Oct 25, 2018 2:04 pm

Re: wxExecute invoking window in Windows, not so in Linux

Postby p_lu » Mon Jan 07, 2019 8:36 pm

Looks like

#define SH "/usr/bin/lxterm -geometry 100x30 -e /bin/sh -c \'"

works fine.

Thanks.


Return to “Platform Related Issues”

Who is online

Users browsing this forum: Google [Bot] and 3 guests