Recent

Author Topic: Change default CMD in console mode programming  (Read 7723 times)

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Change default CMD in console mode programming
« on: July 08, 2015, 10:38:38 pm »
Hi,
 
Is there a way to change default cmd when we develop console application so other console will open instead of windows's default?
I tried ConEmu and it has a Default terminal option but it wont effect Lazarus.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: Change default CMD in console mode programming
« Reply #1 on: July 20, 2015, 04:54:54 pm »
So all windows developers here use default cmd?

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: Change default CMD in console mode programming
« Reply #2 on: July 20, 2015, 05:23:00 pm »
Rename ConEmu's executable to cmd.exe and change your system PATH environment variable so that the directory where renamed ConEmu's executable lies, is first item in the path list. Now Lazarus should start ConEmu executable instead old cmd.exe.

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: Change default CMD in console mode programming
« Reply #3 on: July 20, 2015, 05:55:01 pm »
Rename ConEmu's executable to cmd.exe and change your system PATH environment variable so that the directory where renamed ConEmu's executable lies, is first item in the path list. Now Lazarus should start ConEmu executable instead old cmd.exe.
He's not talking about a shell cmd.exe but about a simple "hello world"-program which runs a standard black console (at least, that's how I understand "console application").

Using an alternative cmd.exe on your system will lead to lots of strange problems (looping of executables, batch files etc). You could also use the "Image File Execution Options" registry entry to let the OS think it's starting cmd.exe but really start conemu.exe. But that leads to the same trouble. B.T.W. ConEmu uses cmd.exe itself to start the real console. So using conemu.exe as cmd.exe will definitely lead to looping.

Anyway... If you set ConEmu as default terminal (via the integration options) a .exe (outside the IDE) will run "via" ConEmu.

From inside the IDE gdb.exe "takes over". I'm not sure how to override the console for gdb.exe but the adding it to the hooked executables doesn't work.
« Last Edit: July 20, 2015, 06:05:35 pm by rvk »

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: Change default CMD in console mode programming
« Reply #4 on: July 21, 2015, 05:45:05 am »
Thank you.
As I think like you so asked here maybe one of the team members can answer.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Change default CMD in console mode programming
« Reply #5 on: July 21, 2015, 07:55:58 am »
If you use f.e. the crt unit you can have any console you like.
Also, I guess you are using windows, so you can also use the hardcore low level api functions: AllocConsole etc, but crt encapsulates that for you. A different option is to use FreeVision (on which the textmode ide is build). Loads of options.
Specialize a type, not a var.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: Change default CMD in console mode programming
« Reply #6 on: July 21, 2015, 08:20:39 am »
Can you explain more? f.e. ?crt ?FreeVision ?

Maximus5

  • Newbie
  • Posts: 1
Re: Change default CMD in console mode programming
« Reply #7 on: July 28, 2015, 10:06:52 am »
You need to do only two steps:

1. Update ConEmu to build 150727 or later
2. Add to the DefTerm hooked executables two files: "lazarus.exe|gdb.exe"

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: Change default CMD in console mode programming
« Reply #8 on: July 28, 2015, 10:43:21 am »
Happy to see you here Maximus5 and thank you for the good job.
I update ConEmu to the last version 150727 and set the setting but there is no change.
Also please update sf version.

 

TinyPortal © 2005-2018