1

I seem to be at a dead end here. I cannot change the terminal for Codeblocks on Windows, although it is a cakewalk in Linux.

  1. The option is greyed out.
  2. Running as admin doesn't work also.
  3. The box has command "bin/sh -c" inside. I installed ConEMU and made it the default terminal for all applications. I found a sh.exe in MinGW/bin/mysys/1.0/ , and opening it runs the ConEMU terminal, and I couldn't find any other file named 'sh' (I also have bash installed in Windows through git). So running sh.exe runs bash in ConEMU.

I searched a lot, but it doesn't seem that anybody's query was fulfilled. How do I change my terminal from the infernal Windows cmd in C::B?

3 Answers 3

1

Almost all words from your question may be trimmed.

So, if your question was in fact "How to set up ConEmu as default terminal for CodeBlocks" you may easily find the answer in docs. Just specify proper names as hooked executables

codeblocks.exe|gdb.exe

You have problems because C:B is trying to execute the following:

C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe "C:\Users\Akash\Google Drive\Codes\codeforces\H_designation.exe"

Do they know that paths with special symbols like spaces must be put in double quotes? Reinstall C:B in the folder without spaces, or run C:B using short names, sort of

C:\PROGRA~2\CodeBlocks\codeblocks.exe
7
  • It didn't work. I checked the register on OS startup and added codeblocks and gdb.exe to the hooked executables. Then restarted and ran a program from within codeblocks.(Also, I am using a separate 64-bit MinGW compiler with C::B, not the default one).
    – goelakash
    Aug 19, 2015 at 10:41
  • And what version of ConEmu you've tried?
    – Maximus
    Aug 19, 2015 at 14:04
  • The latest alpha - 150816
    – goelakash
    Aug 19, 2015 at 16:46
  • Than turn on checkbox "Enable logging of hooked executable", try to start your app from CB, upload LogFiles and show screenshot of settings JIC.
    – Maximus
    Aug 19, 2015 at 20:24
0

You can try this solution. It works form me. I am using 'cmder' http://cmder.net/ download it. Make it as default terminal emulator(from its settings) then,

Since codeblocks does not execute the console project directly but by using its 'cb_console_runner.exe' program (located in codeblocks directory) your console application is not getting hooked by ConEmu or cmder.

!!TRY THIS ONLY IF YOU KNOW WHAT YOU ARE DOING!!

Its a kind of hack trick. Lets replace the codeblocks 'cb_console_runner.exe' with our own-built.

Follow these steps:

  1. Open codeblocks, in it open a new project or new file
  2. Copy and paste this small program and save it with '.c' (dot c) extension

    #include<stdio.h>
    int main(int argc, char *argv[])
    {
        int retval;
        if (argc>1)
        {
            retval=system(argv[1]);
            printf("\n\nProgram ended with exit status: %d\n\n", retval);
            system("pause");
            return retval;
        }
        else
        {
            printf("Provide a executable path as command line arg");
            return 1;
        }
    }
    
  3. Compile this project or file to obtain its executable (.exe) file

  4. Rename this new executable file to name 'cb_console_runner.exe' and copy it.
  5. Open codeblocks program directory (where original 'cb_console_runner.exe' file is.
  6. Rename the orginal 'cb_console_runner.exe' file to some other name so you can restore it later if required.
  7. Paste your own built 'cb_console_runner.exe' file here

Now open codeblocks and test it with a sample program. It should work fine as it worked for me.

0

i think you guys overcomplicated things hugely...Don't change any codeblocks settings..its just the terminal window you want to adjust. all you need to do is:

1) run your code in code blocks to activate the window

2) then right click on the menu bar to get a menu.

3) Go to properties

4) Adjust both the width and height in your screen buffer size and window size I chose 300x100 for the first one and I think i got a default for the other.

5) Hit ok and the console screen will resize itself.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .