#267 Console 2 crashes on new tab creation

Janne Hellsten

If I create a new tab with the initializing shell command of "foo.bat", the tab creation and thus Console 2 crashes.

Here's a snippet from my configuration file that illustrates the problem:

<tab title="main">
<console shell="c:\tools.bat" init_dir="c:\p4"/>

Changing this to
<tab title="main">
<console shell="cmd.exe /k c:\tools.bat" init_dir="c:\p4"/>

fixes the problem.

I would not expect this usage to crash Console.

Btw otherwise Console is great, I've really liked it thus far.


  • .bat file is not an executable file. Shell must be an executable file.

    I will, however, try to fix the crash problem.

  • I'd be happy with simply giving an error message rather than crashing.

    Thanks for looking into it.

  • Actually, it seems that the problem is that cmd.exe process spawned by starting tools.bat closes before Console finishes initializing the new tab beacuse tools.bat finishes and exits.

    Please try what happens if you put 'pause' as the last command in your tools.bat file...

  • Indeed, if I put "pause" at the end of my startup script, Console waits for pause to finish and then exits the tab.

    I don't really have an opinion on how this stuff *should* work. The reason I filed this bug was because Console just crashed on this special case. As there was no error message but just a crash, I didn't at first realize what I had done wrong. Without so much thought to this, I had just assumed using .bat file directly for my startup scripts would give me the right results, but it seems that "cmd /k" is required.

    Would it make sense to use "cmd /k" automatically for .bat files?

  • using cmd /k does make sense, since cmd.exe that executes the .bat file will not exit when .bat file finishes execution (I guess that is your intention)

    However, I think I have located the cause of the crash, and the fix will be available in the next build.

    • priority: 5 --> 4
    • status: open --> closed-fixed