Here is a 'solution':
=========
Here's the command I use:
Code:
--------
gnome-terminal --disable-factory -t $TITLE -x
--------
The "--disable-factory" argument runs gnome-terminal in it's own process, apart from other gnome-terminal processes you have running. Without it gnome-terminal will return 255 upon exit, unless you have another gnome-terminal already open.
This is still only a partial solution, since gnome-terminal will return 0 to Code::Blocks, regardless of what your program returns... If anyone has a solution to this problem, please let us know.
=========
This solution quoted from: http://www1.ubuntuforums.org/showthread.php?p=10251821
And you can make a little bit change:
--------
gnome-terminal --disable-factory --hide-menubar -t $TITLE -x
--------
or
--------
gnome-terminal --disable-factory --hide-menubar -t $TITLE -e
--------
(maybe can not works)
For me it works without --disable-factory, but this might be due to my gnome settings.
gnome-terminal --disable-factory --hide-menubar -t $TITLE -e
does not work, because it needs quotation around the command after the -e, otherwise only the first parameter is used as command and that can not work (in almost any cases), -x uses the remaining parameters as command.