Command prompt instance counting
Here's something that I accidently noticed today. Inside of a command prompt, of you type "cmd" (to launch a commonad prompt), it treats this as a new instance, though no new windows is opened. Now if you type "exit", the command window still stays since there were effectively two instances. Only when you type "exit" the second time, will the command window close.
This can go on at any level (I didn't really try too many levels). You can also easily make out the # instances by looking at the title bar. Every time you type "cmd" at a command prompt, you will see "- cmd" get added to the title. With every "exit" one of these goes away till you are back to the default title you had started up with and another "exit" will close the window.
Comments
That's a great observation Atul. But after I tried it, I realized it the same thing as Unix does. If you are in ksh and you type bash then you will return to ksh again once you enter exit in bash.
The core reason for this is, the shell (in unix) or command (in windows) and programs which are self recursive. They can run within themselves. So that is why multiple instances can happen this way.
Posted by: nitinpai | November 7, 2008 1:33 PM
Nitin, thanks for the explanation.
Posted by: Atul Gupta | November 17, 2008 5:05 AM
Would there be any provision to make the new instances as a separate one?
Posted by: Jyothikarthik | December 6, 2008 9:14 AM
Jyothikarthik, if you mean new instance as a new window, then i guess you can just get back to start/run and start a new instance as you started the first one.
Posted by: Atul Gupta | December 8, 2008 3:51 AM