Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Small patch to fix running console programs for Linux (Debian, etc)
(1/1)
Sayd:
I noticed that by default my console program is not running after I hit ctrl+f10. I just see opening and immedietly closed xterm.
I got command C::B was trying to run and tryed to exec in my opened xterm:
--- Code: ---xterm -T test-cpp -e /bin/sh -c /usr/bin/cb_console_runner /home/sayd/projects/test-cpp/bin/Debug/test-cpp
--- End code ---
But it closed too.
I fixed command, now it runs as it should be:
--- Code: ---xterm -T test-cpp -e /bin/sh -c "/usr/bin/cb_console_runner /home/sayd/projects/test-cpp/bin/Debug/test-cpp"
--- End code ---
So I decided to fix C::B too:
--- Code: ---Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 4603)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -1748,8 +1748,11 @@
// -- Csh Programming Considered Harmful
command << DEFAULT_CONSOLE_SHELL << strSPACE;
}
+ // each shell execution must be enclosed to "":
+ // xterm -T X -e /bin/sh -c "/usr/bin/cb_console_runner X"
+ // here is first \"
+ command << _T("\"");
}
-
// should console runner be used?
if (target->GetUseConsoleRunner())
{
@@ -1776,6 +1779,10 @@
{
command << execStr << strSPACE;
command << target->GetExecutionParameters();
+ // each shell execution must be enclosed to "":
+ // xterm -T X -e /bin/sh -c "/usr/bin/cb_console_runner X"
+ // here is first \"
+ command << _T("\"");
}
else
{
--- End code ---
Don't know is it ideal to just take and patch, but it may be a place to start fixing problem.
huginn78:
I have exactly the same problem and it has been over a year from OP message.
I have Ubuntu 8.10 and codeblocks Version: 8.02svn5382.
I created new console project.
I did not play with any options.
when I click Play/Run button I got message below, and xterm windows shows for a split second.
Checking for existence: /home/amok/usr/src/cbtest/bin/Debug/cbtest
Executing: xterm -T $TERM -e /bin/sh -c /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/amok/usr/src/cbtest/bin/Debug/cbtest (in /home/amok/usr/src/cbtest/.)
Process terminated with status 0 (0 minutes, 0 seconds)
I wonder if I did something wrong cause I cannot believe that that kind of bug is present for over an year.
Regards.
Navigation
[0] Message Index
Go to full version