Author Topic: Feature Request: launch console window button for console projects  (Read 5051 times)

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
It would be useful if you could have a uniform command that would launch a console window with a primary working directory set to where the current targets executable gets saved.  Mostly when im working on quick test projects that require/allow command line arguments i dont want to have to edit the project to alter the default arguments for testing.  If a button would just pop open a window where i need to be (some paths are annoying to navigate to) and that path would be accurate regardless of build target (thus diff build directory) it would be most useful.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Feature Request: launch console window button for console projects
« Reply #1 on: March 05, 2008, 06:03:33 pm »
It would be useful if you could have a uniform command that would launch a console window with a primary working directory set to where the current targets executable gets saved.
You can simply setup a tool that does so. Open a cmd.exe (the "tool") ansd specify the patch where this shall be opened.
See: Menu "Tools" -> "Configure tools..."
I have setup cmd.exe there (for example) with "${PROJECT_DIR}" as working directory.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline BCCISProf

  • Multiple posting newcomer
  • *
  • Posts: 60
    • Professor Langsam's Home Page
Re: Feature Request: launch console window button for console projects
« Reply #2 on: March 05, 2008, 11:04:32 pm »
For Windows XP there is also a (free) Microsoft PowerToy Called "Open Command Window Here" which allows you to right click on any directory in Explorer and open a console window in that directory.

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Feature Request: launch console window button for console projects
« Reply #3 on: March 06, 2008, 03:41:29 pm »
I have setup cmd.exe there (for example) with "${PROJECT_DIR}" as working directory.
But doesnt that just go to the project directory?  Is there some macro that goes to the binary directory?  I have projects that place the binary in one of several different tools directories, sometimes on removable media, that are not always gaurenteed to even be on the same drive as the project.   I would still like the cmd window to open to the appropriate place based on where the binary is created.

I'll do a test when I have access to my C::B installation to double check but im thinking setting up the tool like that would work if a ${BINARY_DIR} gets added to the environment that always resolves to the correct location.

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Feature Request: launch console window button for console projects
« Reply #4 on: March 06, 2008, 03:46:22 pm »
For Windows XP there is also a (free) Microsoft PowerToy Called "Open Command Window Here" which allows you to right click on any directory in Explorer and open a console window in that directory.

That still requires me to leave the build environment and already have the target directory open.  Instead of being a quick-clickable button accessible from within the IDE, that automatically can determine the binary location based on project settings.  Really looking for a one-step solution =-)

As a side note, the functionality you mention is built into Vista by default with no special tools required.  I think this is the first nice thing i have EVER noticed about vista.  Actually make that 2nd, with the mingw installation of C::B being vista friendly it has 2 nice things about it.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Feature Request: launch console window button for console projects
« Reply #5 on: March 06, 2008, 03:52:09 pm »
I'll do a test when I have access to my C::B installation to double check but im thinking setting up the tool like that would work if a ${BINARY_DIR} gets added to the environment that always resolves to the correct location.

Try "${TARGET_OUTPUT_DIR}" .

You can also use the keybinder-plugin to create a keyboard-shortcut to your new menu entry.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Feature Request: launch console window button for console projects
« Reply #6 on: March 06, 2008, 04:09:30 pm »
Try "${TARGET_OUTPUT_DIR}" .
Amen.

You see a list of the most important macros in the tool config dialog already. ${PROJECT_DIR} was just an example of how I do it - as for me this is also the "top level" directory where I am starting my apps from.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Feature Request: launch console window button for console projects
« Reply #7 on: March 07, 2008, 03:44:16 pm »
Thank you both, very helpful =-)