ActiveState Community

[solved] changing default console from cmd.exe to console2

Posted by yaqob on 2009-10-26 08:51

Hey,
is there a way to change the default windows console (which is started by "run" command) to a custom one (Console2 namely). I've tried changing the enviroment variable "COMSPEC" but this doesnt help

Thanks in advance for any help
Jakub Chodorowicz

toddw | Mon, 2009-10-26 11:11

Hi Jakub,

Try using the environment variable "ComSpec" or "SHELL" (case sensitive).

For reference, the source code for setting the run command is here:
http://grok.openkomodo.com/source/xref/openkomodo/trunk/src/run/koRunSer...

Cheers,
Todd

yaqob | Mon, 2009-10-26 15:08

first of all thanks for the answer!

unfortunately both of these don't work - I've set the path for both of these variables under Preferences->Environment->User Environment Variables but I stil get standard windows cmd

http://www.box.net/shared/9c8kob9ria

They seem to have no effect on the run command. Can it be the problem that Komodo capitalizes all variables upon entering?

toddw | Mon, 2009-10-26 17:04

Try restarting Komodo - the comspec is only checked once by Komodo at startup. Also, try setting these variables in the environment (command prompt or in the system environment variables) before you start Komodo.

yaqob | Tue, 2009-10-27 10:25

thanks for suggestion but it's still not working...

I was of course restaring Komodo. I've changed the ComSpec variable before starting Komodo
http://www.box.net/shared/mj4soxhb4l
http://www.box.net/shared/qzx2a9z1xx
http://www.box.net/shared/to5b92xe8h

A very strange thing happened when I changed a registry entry for ComSpec and then tried to open console through run command in Komodo - the system started to open multiple copies of Console2 (the good one, the alternative) and finally crashed...

Maybe it's something wrong with my setp...

yaqob | Tue, 2009-10-27 12:26

ok, as I've found in the groups of Console 2 ( http://sourceforge.net/projects/console/forums/forum/143117 ) it's a bad idea to change the ComSpec or SHELL varialbes as Console2 is "not a shell (it's actually a wrapper around any console application)" so you can run any shell inside it (cmd.exe, cygwin or any other..)

so I suppose now that Komodo doesnt offer a feature to open this wrapper in a location of a file..

toddw | Tue, 2009-10-27 12:32

If you open a Windows command prompt (cmd), from there what would be the command you'd need to give in order to launch console2 running the "dir" command?

yaqob | Tue, 2009-10-27 13:07

OK, I've solved the problem - finally it was as simple as:
1) setting command to path to Console (E:\programs\portable\Console2\Console.exe in my case)
2) setting "run in No Console (gui application)
3) setting start in %D

Hope these helps somebody in the future

Thanks a lot for your remarks Todd - they surely led to me the solution!

As a sidenote - I've tried to launch E:\programs\portable\Console2\Console.exe with "run in New Console" and this led to an infinite loop of launching Consoles - strange...

Thanks once again!