Welcome!

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

SignUp Now!

TCC window completely disappearing(!!!), sometimes(?) crashing, if Windows Terminal is running (or maybe even, if it's simply *been* run)

Jul
207
6
I spent way too long wondering why "import openai" was crashing python so hard that the calling window disappeared, and how that was even possible. Then I realized.

TCC is disappearing. And sometimes reappearing. But usually disappearing. For good.

Only after I installed windows terminal yesterday. [Incidentally, this makes TCC display unicode/emoji filenames perfectly!]

And sometimes I think it's crashing -- but it's hard to know sine it's disappeared.


Basically, I can't run long jobs in a standalone TCC.EXE anymore. I either won't be able to see them or they won't complete. I *have* to run them in Windows Terminal.
 
You'll find problems with WindowsTerminal too, but probably not with scripting. TCC relies on GetConsoleWindow() for some things (e.g., positioning dialogs). In WT GetConsoleWindow() returns a handle to a window of class "PseudoConsoleWindow" (not "ConsoleWindowClass"). That window is typically hidden, very small, and uninteresting, and it doesn't respond to some APIs as a ConsoleWindowClass window does. Sometimes TCC makes that window visible when trying to restore focus to the console after displaying a dialog. The first time that happened to me it was a little unnerving because I had no clue what it was.
 
You'll find problems with WindowsTerminal too, but probably not with scripting. TCC relies on GetConsoleWindow() for some things (e.g., positioning dialogs). In WT GetConsoleWindow() returns a handle to a window of class "PseudoConsoleWindow" (not "ConsoleWindowClass"). That window is typically hidden, very small, and uninteresting, and it doesn't respond to some APIs as a ConsoleWindowClass window does. Sometimes TCC makes that window visible when trying to restore focus to the console after displaying a dialog. The first time that happened to me it was a little unnerving because I had no clue what it was.

Very ineresting.

In my case, these are texts processing scripts that have no GUI interaction. Merely importing [some] python packages triggers it [some(?)itimes]. Or maybe it's python itself.

and i mean like:

python.exe
>>>>import openai
<window vanishes>


side-note: been experimenting with a utility function claire.tick() that you can just put in any for loop of any frequency to cycle the console colors so you know your program isn't hung, since some programs deliberately can't output unwanted stdout because their stdout is being captured and meant to be a certain way.

and then a claire.tock() after the loop to reset your colors (which would require resetting every color to a fixed rgb value that is not necessarily the original one because windows OSC ansi to read the RGB colors of color codes doesn't exist. that part is wrong and i'm left with weird artifacts and a blue cursor, lol)

It's total madness because it's computationally expensive, even checking the time elapsed between call intervals is too computationally expensive if it's a loop that runs 100K times a second, so i'm going to have to adaptiveness to how often it checks the time elapsed, probably with a rolling average of sorts. That way it can just be called mindlessly with tick() and not having to worry about overload as much (But realistically, probably still will).
 
You mentioned the console disappearing. In many of my tests in the "ANSI" thread, if I were in WindowsTerminal, WindowsTerminal would disappear momentarily (as if quickly minimized/restored). Nothing ever crashed; it always came back and the tests completed. I can't even guess what's going on. I wish I could reproduce it without TCC; I can't. It'd be a good one to report in the WT forum. The disappearing was not correlated with the ANSI control sequence screw-ups.
 
Oh, I get that sometimes. Along with a forced maximizing/fronting. It's why I started looking into windows terminal. If I didn't have 4 screens totaling 29 feet i might be more annoyed at losing a screen by forced maximizing/fronting of the window during long (hours long) jobs.

But yea in my case, the window is gone. Over done zilch gone finished over out. Run in windows terminal if i want it to complete.

[Windows terminal had it's own set of problems. It would infinitely repeat calling TCC in a way that would thrash the machine unless you issued a process kill in a separate command line about 5 times to get the timing right.................... but laughably only if you set a custom icon for TCC. And yes, I made sure it wasn't just the Duckman icon i was trying to use. Those were weeds i wasn't expecting to explore yesterday]
 
And admittedly my environment is super complex and built up over 30 yrs so it could easily be the strange things i do like have colortool.exe called every window invocation to use a randomly-selected INI file with a slightly different shade of black so that i can tell when one TCC begins and another ends because windows removed the ability of thick border windows with windows 10 when i finally upgraded last year.

so, could always be me
 
You need to be a little clearer here. In the OP, you say



“Basically, I can't run long jobs in a standalone TCC.EXE anymore. I either won't be able to see them or they won't complete. I *have* to run them in Windows Terminal.”



You cannot run “TCC.EXE” as “standalone”. It has to run in some kind of terminal window. Mostly that would come down to conhost, TCMD, or Windows Terminal although there are other choices. I assume you mean “conhost” when you say “standalone”?



I have been running TCC inside Windows Terminal for quite some time, and I have not observed any of the problems you’re describing, with or without a custom icon.
 
You need to be a little clearer here. In the OP, you say

“Basically, I can't run long jobs in a standalone TCC.EXE anymore. I either won't be able to see them or they won't complete. I *have* to run them in Windows Terminal.”

You cannot run “TCC.EXE” as “standalone”. It has to run in some kind of terminal window. Mostly that would come down to conhost, TCMD, or Windows Terminal although there are other choices. I assume you mean “conhost” when you say “standalone”?

I didn't say i cannot run TCC.ee as standalone. I said "Basically, i can't run long jobs" in it. Not the same thing or I would have stated it as such. The disappearing that started after installing windows terminal has made that situation untenable outside of windows terminal. I can still run it all I want. Only some things make it disappear, like python. Perl seems fine. So some of my internal scripts trigger it, and others don't. Particularly newer python projects i've been working on.
 
I guess this one of several reasons to be switching to windows terminal. It does have some really nice features.
 
Yup, at this point I've pretty much given up on getting things done in TCC.exe without the windows terminal container.

I don't know what changes when windows terminal is installed, but wow.

Forced change can be good sometimes, buuut.
 

Similar threads

Back
Top