Welcome!

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

SignUp Now!

[36.50.71]_%ConPTY=1 in a TCMD conhost tab

Jan
1,189
25
_%ConPTY is always 1 in TCMD tabs.

Here it's ok:

Screenshot 2026-07-09 164709.webp



But HERE it's clearly a Conhost tab, so here it should be 0:

Screenshot 2026-07-09 164725.webp
 
Not reproducible here. It's unclear to me why your second example is "clearly a Conhost tab".

And both tabs are probably conhost tabs, unless you're using openconsole in the first example. A ConPTY session can use either conhost or openconsole.

Are you using the TCC internal %_conhost variable, or one from a plugin?
 
It's not always 1.

1783611344417.webp


And there's this. I don't know how reliable it is.

Code:
v:\> echo %@winapi[user32,GetClassName,%@winapi[kernel32,GetConsoleWindow],buffer,32]
ConsoleWindowClass

versus

Code:
v:\> echo %@winapi[user32,GetClassName,%@winapi[kernel32,GetConsoleWindow],buffer,32]
PseudoConsoleWindow
 
Rex, it IS a conhost tab, because the ConPTY checkbox is not activated.

Few builds ago, the conpty var was = 0 yet.

Also because it had never the bad effects (with truncated lines for example) or so in that tab.

Also, see another thread

Open a TCMD Tab with a Conhost TCC Session​

I'm not alone.

PS: Maybe also important, that Conhost tab is a tab which is defined in the TCMD options to open with TCMD start.
 
Definitely reproducible here. I run start /tab /pgm C:\PROGRA~1\JPSoft\TCMD36\tcc.exe. A new tab opens with the following content (I added some code to TCSTART.BTM to display some session info):

Code:
TCC Version: 36.50.71
TCMD Tab:    Yes
ConPTY:      Yes
Elevated:    No

TCSTART complete.

[TCC36.50.71 (6324) C:\Users\Jay\Dropbox]

Nothing in that session is consistent with it's being a ConPTY session. Vince's check seems to confirm that.

Code:
->echo %@winapi[user32,GetClassName,%@winapi[kernel32,GetConsoleWindow],buffer,32]
ConsoleWindowClass

Rex, somewhere you asked if anyone really needs the _conpty variable. I am currently using it to add a tabtint to tabs that do not have the standard console session. If you took it away, I guess I could use Vince's code or the plugin.
 
Thanks, Jay, for confirmation!

Just for info yet, Rex - thats the tab config:

Screenshot 2026-07-09 212708.webp


And, just as I said, at least in first v36 build, it was definitely conpty = 0 yet ... I hadn't checked it since then until now.
 
Ok, but my example is a conhost tab without ConPTY activated.

So, WHY is ConPTY=1 there?
 
Rex, there is no question that sometimes the variable _conpty is giving erroneous information. @Apengreis is not the only one seeing this.
 
But I still don't know why anyone needs %_conpty.

In one of the posts here, I gave my answer. I use the new TABTINT facility to add a colored bar to tabs that are not running a standard (in my case, pseudo-console) TCC session. I color those that are not ConPTY and those that are elevated. There's nothing essential about that; it's mostly for fun. I could skip it entirely or use Vince's winapi code to determine the type of session.
 
It might also be useful to determine what kinds of ANSI codes are available. The Coca-Cola Classic console window doesn't support stuff like italics and underlining, right?
 
Works now correctly in build 73, thank you!
 
Back
Top