xfce4-terminal -T 'test' -e 'LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH /usr/bin/cb_console_runner "/home/cly/CB_Projects/test/bin/Debug/test" '
This doesn't work, because xfce4-terminal try to excute a program named "LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH".
And if I delete the "LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH", it's behavior is correct.
xfce4-terminal -T 'test' -e '/usr/bin/cb_console_runner "/home/cly/CB_Projects/test/bin/Debug/test" '
But I can't find where to set it in codeblocks,
so I wrote a perl wrapper, and set [Terminal to launch console program](Setting -> Environment -> General setting) to "/home/cly/.codeblocks/xfce4-terminal.cly -T $TITLE -e ".
(Note the blank after "-e")
the ugly script(it's more like a c program)
#!/usr/bin/perl -w
while ($arg = shift(@ARGV)) {
if ($arg eq '-e') {
@cmd = split(' ', shift(@ARGV));
for ($i = 0; $i < @cmd; ++$i) {
if (!($cmd[$i] =~ /=/)) {
last;
}
}
$tmp = "";
for ( ; $i < @cmd; ++$i) {
$tmp .= " " . $cmd[$i];
}
push(@args, '-e', $tmp);
}
else {
push(@args, $arg);
}
}
exec("xfce4-terminal", @args);
Is there a better way to use xfce4-terminal with codeblocks?