Menu

#261 cb_console_runner is started using ambiguous path

Next_Release
fixed
Bug_Report
2018-12-16
2015-11-23
Maximus5
No

CodeBlocks version: 13.12
OS version: Windows (7, 8, any)

By default, CodeBlocks is installed into the following folder: C:\Program Files\CodeBlocks. So, when user runs console application (just a cpp file in my case, no project at all), CB calls CreateProcess to run cb_console_runner.exe, but tries to do that without doublequotes around path. So, the following command is executed:

C:\Program Files\CodeBlocks/cb_console_runner.exe "C:\Temp\Tests\helloworld.exe"

The path "C:\Program Files\CodeBlocks/cb_console_runner.exe" must be quoted, same as the argument, to avoid malfactioning.

Sample application

#include <cstdio>

int main(int argc, char* argv[])
{
    printf("Hello world\n");
    return 0;
}

The problem was initially reported to ConEmu (here and here). Users were not able to use ConEmu as terminal for running console applications from CB.

Discussion

  • Morten MacFly

    Morten MacFly - 2015-11-23

    As a long-term Far and therefore ConEmu user I am taking over...

     
  • Morten MacFly

    Morten MacFly - 2015-11-23
    • labels: --> console_runner
    • status: open --> accepted
    • assigned_to: Morten MacFly
    • Type: Undefined --> Bug_Report
    • Milestone: Undefined --> Next Release
     
  • Morten MacFly

    Morten MacFly - 2015-11-23

    Should be fixed in trunk. Any feedback is welcome, alough you'll have to compile C::B yourself or wait until the next nightly is released.

     
  • Morten MacFly

    Morten MacFly - 2015-11-23
    • status: accepted --> fixed
     
  • Adam

    Adam - 2018-12-16

    I have been having a similar issue on Linux when setting up "sakura" as the terminal emulator.

    Specifically, when cb_console_runner launches sakura, it's supposed to launch sakura in the correct project folder (or the manually-specified launch folder as appropriate). What actually happens is nondeterministic - about ~75% of the time things work fine, but ~25% of the time sakura ends up being launched in ~ (/home/$USER), and thus any programs which read/write files fail spectacularly.

    I can't reproduce the issue with other terminal emulators (e.g. xterm), however there are several other applications which are capable of launching sakura at a desired directory (e.g. pcmanfm, the file manager) without any problems.

     

Log in to post a comment.