User forums > Using Code::Blocks

Use xfce4-terminal to launch console programs

(1/1)

clyfish:

--- Code: ---xfce4-terminal -T 'test' -e 'LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH /usr/bin/cb_console_runner "/home/cly/CB_Projects/test/bin/Debug/test" '
--- End code ---
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.

--- Code: ---xfce4-terminal -T 'test' -e '/usr/bin/cb_console_runner "/home/cly/CB_Projects/test/bin/Debug/test" '
--- End code ---

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)

--- Code: ---#!/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);

--- End code ---

Is there a better way to use xfce4-terminal with codeblocks?

sasq:
Same here, with aterm. Any solutions?

nmtservice:
Maybe this will cause a lot of unrelated issues, but I suggest you to change -e  with eXecute switch -x :)

Navigation

[0] Message Index

Go to full version