start /tabna leaves blank windows when running batch scripts

Nov 15, 2010
8
0
Hi Folks,
I'm running one
START /TABNA after another in a batch script in order to setup my preferred development environment (which is take command of course!)

I'm using TakeCommand V15 64 bit but I tested this under several versions - it seems to have the same issue.

It looks like this:

REM File: SETDEV.BTM
start "build client" /tabna tcc /c "buildjs" watch
start "build node" /tabna tcc /c "buildnode" watch
start "test client" /tabna tcc /c "testjs"
REM start "test node" /tabna tcc /c "testnode"
start "test lib" /tabna tcc /c "testlib"
start "fossil" /tabna "fossil" ui --port 8967

buildjs, buildnode, testjs, testnode are all batch files that run NodeJS commands. NodeJS is a Javascript interpreter based on Chrome's V8 engine.

When I run this simple batch script, I get a bunch of "broken" tabs. That is, they show all white windows and each has a tab name that is missing -- except for the fossil one at the end which always works well (and isn't a batch file.)

To fix, I tried inserting delay commands between each start. This had no effect.

Now, when I run the same script under ConEmu it works fine (from that perspective but ConEmu has other issues).

Any ideas?
Ron
 
Nov 15, 2010
8
0
Ok, here's a shorter version you can run yourself to see the problem.

create a batch file called donothing.bat
rem file:donothing.bat
echo doing nothing

then run it in a tab:

start "donothing" /tab donothing.bat

I get a window that is all black and shows nothing. it just hangs. The windows cursor goes to a spinning circle. The tab has no name and I don't get the output from the echo command.
 
May 20, 2008
11,380
98
Syracuse, NY, USA
With any of v15, v16, and v17, it works sometimes and fails sometimes. When it fails, I see the likes of this.
upload_2015-1-8_13-28-47.png

I can close the bad tab, but after all this testing I have 16 orphaned instances of TCC.
 
Nov 15, 2010
8
0
Ok I've done a bit more testing. It appears that .EXE files run just fine in the other tab. I've run Digital Mars C++, Perl, Far Manager, and all work fine. The problem seems to be limited to batch files. Also, it works fine from the command line - I can execute each line of my script and it works fine. When run in a batch, it fails (different) each time, where failure is one or more broken tabs.
 

rconn

Administrator
Staff member
May 14, 2008
12,340
149
Ok, here's a shorter version you can run yourself to see the problem.

create a batch file called donothing.bat
rem file:donothing.bat
echo doing nothing

then run it in a tab:

start "donothing" /tab donothing.bat

I get a window that is all black and shows nothing. it just hangs. The windows cursor goes to a spinning circle. The tab has no name and I don't get the output from the echo command.

Do you get that running it once manually from the command line? I tried it 100 times here (manually) and couldn't reproduce it. Then I put it in a batch file loop and I could see it happen maybe three or four times out of a hundred.

Unfortunately, in the case of the loop it isn't TCC, it's the Windows create & attach console api's - they just do not behave well if called really fast from the same session. (Old bug; Microsoft knows about it but hasn't ever fixed it.)

There's another potential problem here - if you start a new tab that exits immediately (as in your "tcc /c" example), there's a good chance that the session will exit before TCMD can attach to the console and create a tab for it.

What happens with your original batch file if you add something like a "delay 1" (i.e., "start "build client" /tabna tcc /c (delay 1 & "buildjs" watch)"?
 
May 20, 2008
11,380
98
Syracuse, NY, USA
Not even a 5 second delay helps in the one I reported. Using
Code:
v:\> type donothing.btm
delay 5
echo Doing nothing!

v:\> start "donothing" /tab donothing.btm
Sometimes a dead tab is created (no title, no output) and the TCC is orphaned when the tab is closed. It also happens sometimes if I use /tabna.
 

rconn

Administrator
Staff member
May 14, 2008
12,340
149
Not even a 5 second delay helps in the one I reported. Using
Code:
v:\> type donothing.btm
delay 5
echo Doing nothing!

v:\> start "donothing" /tab donothing.btm
Sometimes a dead tab is created (no title, no output) and the TCC is orphaned when the tab is closed. It also happens sometimes if I use /tabna.

Never reproducible here. But I made a change to work around the Windows bug that causes TCC to display an empty GUI window instead of a console window in the tab (because Windows is returning a null or invalid handle when querying the console).
 
Nov 15, 2010
8
0
Never reproducible here. But I made a change to work around the Windows bug that causes TCC to display an empty GUI window instead of a console window in the tab (because Windows is returning a null or invalid handle when querying the console).
Not even a 5 second delay helps in the one I reported. Using
Code:
v:\> type donothing.btm
delay 5
echo Doing nothing!

v:\> start "donothing" /tab donothing.btm
Sometimes a dead tab is created (no title, no output) and the TCC is orphaned when the tab is closed. It also happens sometimes if I use /tabna.

Never reproducible here. But I made a change to work around the Windows bug that causes TCC to display an empty GUI window instead of a console window in the tab (because Windows is returning a null or invalid handle when querying the console).

Thanks for looking into this.

The key seems to be whether I'm running a batch script or an EXE. If it is an EXE, it never has the problem.

I tried this again today (2/14/2015) with TCMD17 "32-bit" and the problem did not occur! (2/8/2015 build) I tried repeatedly to make it fail and couldn't. I retested with V15 (32 and 64 bit) and it failed immediately. I tried V 17 -64 bit but I had tried this in the past and my 30 day key had expired!

Sounds like my solution is to upgrade to V17, which I will do.
 
Nov 15, 2010
8
0
Thanks for looking into this.

The key seems to be whether I'm running a batch script or an EXE. If it is an EXE, it never has the problem.

I tried this again today (2/14/2015) with TCMD17 "32-bit" and the problem did not occur! (2/8/2015 build) I tried repeatedly to make it fail and couldn't. I retested with V15 (32 and 64 bit) and it failed immediately. I tried V 17 -64 bit but I had tried this in the past and my 30 day key had expired!

Sounds like my solution is to upgrade to V17, which I will do.

Just for posterity - my exact version is:TCC 17.00.75 x64

Working like a champ!
 
Similar threads
Thread starter Title Forum Replies Date
J Take command does not start on Windows 10 Support 3
N for start /b anamoly Support 1
U Can not get/start Take Command gui Support 1
DrusTheAxe START /? is incomplete Support 2
S How to? Runs start /w in invisible mode OR run program after exit of another one Support 3
vefatica Start/stop screensaver from TCC? Support 12
S START with title Support 4
vefatica START at 0,0? Support 2
D START /POS versus @WINPOS and @WINSIZE Support 12
vefatica START /elevated and PcaSvc? Support 5
S incorrect message at start Cancel batch job 4START.bat ? (Y/N/A) : Support 1
vefatica START /PGM "name with spaces.URL" fails Support 2
L Peculiarities of how START launches processes Support 15
R How to? START program as top window? Support 2
Peter Murschall v24 IDE/BDEBUGGER won't start Support 9
Dmitry L. Kobyakov WAD Start /pgm "name.htm" works improperly Support 4
Joe Caverly START Dialog usage of %_ variables Support 0
A Fixed [23.0.22]: TCMD crashes shortly after start, TCC keeps running in background Support 6
kb6ojs Want to start TCMD v20 with every Windows 10 bootup Support 3
vefatica START *command Support 5
Per TCC/LE 14 64-bit won't start on Windows 10 Insider Preview 17063 (171213) Support 12
A Fixed (CMD compat) START /D fails to recognize the switch option. Support 3
MikeBaas start /runas - I'd like /netonly Support 2
vefatica Start VIEW with the toolbar showing? Support 5
vefatica Documentation START /AFFINITY Support 0
B how to do in "start" command thing like in tcc.exe Support 1
J directory or folder to start in Support 2
R How to? Not have RT version show on start Support 3
D WAD START /ELEVATED "Title" /PGM "job.btm" Support 6
J How to? Start TCMD with different configurations Support 3
vefatica START /K ... Support 1
vefatica Documentation START /AFFINITY Support 5
vefatica Start TCMD with File Explorer showing? Support 2
Alpengreis WAD Each start/close of TCMD changes my Explorer setting Support 7
WadeHatler Just started getting a message about Cloud Storage every time I start TCC 19 Support 3
Alpengreis Fixed TCMD FileExplorer Start-Directory problem Support 4
vefatica Shortcut/start-up folder nonsense Support 20
fishman@panix.com Can I start TCC in full screen mode? Support 9
R Unable to start any BTM file from Explorer Support 5
fpefpe How to? Stange start up issue Support 1
M Start "/Elevated" failure... Support 3
vefatica START, CMD vs. TCC Support 0
Steve Pitts Difference in exection with and without START Support 24
vefatica Start-up directory for new tabs? Support 7
C OT: Registry OPEN verb to start elevated... Support 2
tmaynard Error on Take Command Start after recent update Support 2
M How to? Start a program on log on elevated abovenormal Support 5
M How to? Start the version of Take Command that I want... Support 7
C 'start tcmd.exe' actually starts tcc.exe Support 7
vefatica All my old TCMDs start slowly Support 9

Similar threads