Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Underlining?

May
15,047
271
[Inspired by @Jay Sage's recent thread about conhost]. In a normal (conpty) tab I did this.

1783514641837.webp


I got a new tab as expected. The original tab (the one pictured above) is (1) now unresponsive and (2) using all of one processor.
 
I'm not seeing that (and I have tried several times).

What happens for me is that a TCC session starts out in a new tab, but it is that strange kind that reports that it is a ConPTY session, but in every other respect it is a legacy console session.

I get the same thing with a simple start /tab.
 
It's much more difficult for me to try to duplicate the issue when you post screenshots instead of a code block (where I can cut & paste).
Do the first two in a tab. Return to the first tab. Do the third. Return to the first tab.

Code:
set prompt=$e[0m$e[4m$e[92m$p$g$s$e[0m$e[?25h
start /tab /pgm d:\tc36\tcc.exe                                              
start /tab /pgm d:\tc36\tcc.exe
 
You don't need the underlining. Do this.

Code:
start /tab /pgm %comspec

Return to the original tab and do this again.

Code:
start /tab /pgm %comspec

Original tab now dead and using lots of CPU.
 
I have no problem. The original tab is still working, and CPU usage is normal. (I did put quotation marks around %comspec, since it has spaces in the path.)
 
What happens for me is that a TCC session starts out in a new tab, but it is that strange kind that reports that it is a ConPTY session, but in every other respect it is a legacy console session.

It must be a non-ConPTY session, because there's no way to attach a ConPTY session. Because TCC cannot create one. Only a terminal app (TCMD or WT) can do that.

A START /TAB (or /TABNA) never creates a ConPTY session - TCC starts a hidden (non-ConPTY) session and then tells TCMD to attach it.

A START /Profile=xxx can create a ConPTY session, because TCC passes the profile to TCMD and (depending on the profile settings) TCMD can create the pseudoconsole.

So something in your system is confusing the %_conpty check - are you using the internal TCC variable, or a plugin variable?
 
Seems hard-wired here. With no plugins anywhere. Do this twice from the same tab and return to that tab.

Code:
start /tab %comspec /ip
 
[Inspired by @Jay Sage's recent thread about conhost]. In a normal (conpty) tab I did this.

View attachment 6062

I got a new tab as expected. The original tab (the one pictured above) is (1) now unresponsive and (2) using all of one processor.

Your new tab will be a non-ConPTY tab, and the underlining (which has to be done by conhost) will not be recognized by the TCMD tab window.
 
It has nothing to do with underlining (my mistake originally). I even tried it with no PROMPT at all (using the default) ... same. The new tabs are fine. It's the original tab, where I gave the two START commands, that's screwed up.
 
Yes I did; it's the original (now useless) TCC.

And (maybe a clue) ... having made two new tabs with start/tab %comspec, if I kill the original tab (via its tab's X) the first of the two new tabs closes with it.
 
And (a different problem) if I start a new tab with start /tab %comspec /ip and EXIT the original tab, the new tab disappears with it.
 
And (a different problem) if I start a new tab with start /tab %comspec /ip and EXIT the original tab, the new tab disappears with it.

That's what I would expect, since you didn't specify /BREAKAWAY. The new TCC's session is part of the original session's job, so it gets terminated when the first TCC exits.

But given that this probably isn't going to be as obvious to most users as it is to me, I think I'll make a change to default to /BREAKAWAY if you specify /TAB or /TABNA in START.
 
Two questions:
  1. What is the option "/ip"? When I include that, I get an error message: The parameter is incorrect. "ip"
  2. If I run start /tab and then close the TCC session from which that command was issued, the new tab is not closed. Why is it closing for Vince but not for me?
 
@Jay Sage

See here for that option:


But I have no idea why you receive an error with ... (I haven't tested it till now).
 
Here is the command line I was executing when I got the error message:

start /tab "C:\Program Files\JPSoft\TCMD36\TCC.EXE" /ip

However, the following command, which uses the short file name and no quotes, works fine:

start /tab C:\PROGRA~1\JPSoft\TCMD36\TCC.EXE /ip

If I add (non-functional) quotation marks, I get the error again.

start /tab "C:\PROGRA~1\JPSoft\TCMD36\TCC.EXE" /ip

I wonder if START is getting confused between the window title and the program command line. That should not be a problem, because it does not occur when the /ip is omitted. But the following do work:

start /tab /pgm "C:\PROGRA~1\JPSoft\TCMD36\TCC.EXE" /ip
start /tab /pgm "C:\Program Files\JPSoft\TCMD36\TCC.EXE" /ip

So it looks like a little glitch with the START command.
 
You omitted /PGM so START thinks the quotes string is a title and that /IP is an (incorrect) parameter (to START). There's no error without /IP because with no program name START will start tcc.
 
You omitted /PGM so START thinks the quotes string is a title and that /IP is an (incorrect) parameter (to START). There's no error without /IP because with no program name START will start tcc.

Yes, I guess you're right. As I entered the command, it would have been treated as if it were

start "C:\PROGRA~1\JPSoft\TCMD36\TCC.EXE" /tab

Indeed, the help does say: START always assumes that the first quoted string on the command line is the title. I thought that that would not be true if there were intervening options and that the /pgm option would be needed only if there were no other options before a quoted command.

It's too late now, probably, to change the START command to interpret a quoted string as the title only if it occurs, as shown in the help, before another option.

In my scripts and aliases I always use the /pgm option, even if there is no title. Then I don't have to worry. I ran into trouble here because I was trying to copy your sample command line -- but I had to quote mine.
 
I think I'll make a change to default to /BREAKAWAY if you specify /TAB or /TABNA in START.

/BREAKAWAY doesn't seem to help. If, with only the default tab running, if I issue START /BREAKAWAY /TAB %COMSPEC I get a new tab and when I EXIT the original tab, both tabs (and TCMD) disappear.

In fact, I did that experiment a dozen times, all with the same result. But three of those resulted in a crash and a DMP file. This is from the event log.

Log Name: Application
Source: Application Error
Date: 2026-07-13 09:46:30
Event ID: 1000
Task Category: Application Crashing Events
Level: Error
Keywords:
User: JJ\vefatica
Computer: jj
Description:
Faulting application name: tcmd.exe, version: 36.50.71.0, time stamp: 0x6a4c4fad
Faulting module name: ntdll.dll, version: 10.0.26100.8521, time stamp: 0xccc028d4
Exception code: 0xc0000005
Fault offset: 0x000000000001d730
Faulting process id: 0xE48
Faulting application start time: 0x1DD12CDFC99D9CF
Faulting application path: D:\tc36\tcmd.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: 5ff59080-74ee-4098-a0b8-7506a2e3c454
Faulting package full name:
Faulting package-relative application ID:
 
That would break the ability to enter a quoted command argument unless you always entered a title.

On the contrary. Everything would work very easily if the rules were:
  1. A title string, if entered, must be entered immediately after the START command, before any options.
  2. Any string that appears after any options is interpreted as the command line.
  3. If no command line string is entered, it defaults to "%_cmdspec" to open a TCC session.
So all of the following would work easily.

start "string"Opens a TCC session with title "string".
start /anyoption(s) "string"Opens the command specified in "string". The options do not need to include /pgm. start /pos=... or start /tab would suffice. The option /pgm would be needed only if no other option was wanted. It functions basically as /noop, doing nothing but forcing "string" to be interpreted as the command line instead of the title. It would not even have to be the last option among other options.
start "string1" [/options] "string2"Run the command in "string2" with the title in "string1". This works whether or not options are present

It could even be handy to have an option /tcc that represents "%_cmdspec". Then one could start a new TCC session with TCC options or arguments without having to enter the command string.

start /tcc /ip
start /tcc myscript
start /tcc myalias

That option, unlike /pgm, would have to be the last option of the start command, since anything after it would be interpreted as part of the command string invoking tcc.exe.

And it would break CMD compatibility.

I can't speak to that. I'm not sure that I have ever used a Microsoft command processor. I don't remember a time when I was not at least using 4dos. And if I needed to run someone else's CMD script, I would use CMD to run it, since I can rely on CMD being 100.000% compatible with CMD :-) Right down to the very last bug and mis-feature and limitation.

Of course, I understand, Rex, why this is an issue for you. However, I would think that adding a /tcc option would not cause any problem.
 
Back
Top