TCC does not pass focus to applications launched by TCC from Windows Terminal

May 30, 2022
31
0
I am becoming rather fond of Windows Terminal, I'm running the latest preview under Windows 11. I have it setup to run CMD, CMD as Admin, Powershell, the latest Powershell Preview, Ubuntu (WSL), and, of course, TCC. When I launch an application (Notepad, for instance) from TCC inside WT, the launched application does not receive focus, the focus stays with the TCC window inside WT. This does not happen with CMD or Powershell or Ubuntu. And it does not happen when I'm running TCC from Conhost or TCMD. Any ideas how to fix this?
 
May 30, 2022
31
0
"ver" returns:
TCC 28.02.18 x64 Windows 11 [Version 10.0.22000.708]


Windows Terminal Preview
Version: 1.14.1452.0
 
May 20, 2008
11,867
121
Syracuse, NY, USA
That's exactly my setup. I don't think WT could affect that if it tried. And I don't know to make TCC do that. Is your WT command line for TCC peculiar in any way? Are you simple typing "notepad" at the prompt? Does it happen with all GUI apps?
 
May 30, 2022
31
0
It happens with all applications that launch in their own window, the new window does not get focus. And yes, simply typing "notepad" at the prompt causes this behavior.

{
"commandline": "C:\\TCMD\\tcc.exe",
"guid": "{61c54bbd-c2c6-4271-96e7-119a87ff43bf}",
"hidden": false,
"name": "JPSoft TCC"
},
 
May 20, 2008
11,867
121
Syracuse, NY, USA
OK, thanks. I'm at a loss. I don't think I could make TCC or WT do that if I tried. Maybe others will have ideas.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,596
97
Albuquerque, NM
prospero.unm.edu
Works as expected here. However, I'm using a release version of Terminal: 1.12.10982.0. If this only happens in the preview version, then it's probably a bug which should be reported to the Terminal team.
 
May 20, 2008
11,867
121
Syracuse, NY, USA
I mentioned it in the git-hub forum. Dustin Howett's initial response was that windowing changes were made in 1.14; he asked for versions, which I posted. I'm waiting/hoping for a further response.

Charles, WT release version 1.13.11431.0 is available.
 
May 20, 2008
11,867
121
Syracuse, NY, USA
FWIW, ....0 is what WT calls the "StoreVersion". Depending on access to the file you might be able to get a "BinaryVersion" (which seems more revealing) like this (below). I have no access problem because I install (to d:\wt and d:\wtp) by simply unzipping. My (recently edited) VER.BTM contains

Code:
set xmlfile="%[wtpath]buildinfo.xml"
set wtver=%@xmlgetattr[%xmlfile,BinaryVersion]

It reports

Code:
TCC 28.02.18 x64
Microsoft Windows 10 Pro for Workstations
10.0.19044.1706 (2009, 21H2)
WindowsTerminalPreview 1.14.2205.23002
 
May 30, 2022
31
0
<BuildInfo BinaryVersion="1.14.2205.25002"
SemanticVersion="1.14.220525002-preview"
StoreVersion="1.14.1452.0"
BuildDefId="unknown"/>
 
May 30, 2022
31
0
Okay, mystery solved. It is definitely the Windows Terminal Preview. I navigated down to

C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.12.10983.0_x64__8wekyb3d8bbwe

and from there ran

wt c:\tcmd\tcc.exe

That instance behaved in the way I expected, when I launch Notepad, focus goes to the newly created Notepad window.
 
May 30, 2022
31
0
I installed "windows terminal preview" from the Microsoft Store. My understanding is that once you do that, you will automatically get any new previews when they are released.
 
May 20, 2008
11,867
121
Syracuse, NY, USA
I installed "windows terminal preview" from the Microsoft Store. My understanding is that once you do that, you will automatically get any new previews when they are released.
So the store is ahead of GitHub! I always get the latest two (release/preview) from GitHub and install by simply unzipping to the locations of my choice.

I have to wonder if your 1.14.2205.25002 (vs. my 23002) is the culprit. I mentioned the 23002/25002 discrepancy in the WT forum. There has been no further comment.
 
May 20, 2008
11,867
121
Syracuse, NY, USA
@ohenryx, in an attempt to rule out (most of) your TCC configuration, can you try this?

Code:
[path_to]\wt.exe nt [path_to]\tcc.exe /ii

That should start TCC in a new tab without processing your TCMD.INI file. See how notepad fares there.
 
May 30, 2022
31
0
Okay, that worked. I did a quick comparison of the values shown by "OPTION" command, and the main difference was this:

GlobalAliases=No
GlobalDirHistory=No
GlobalFunctions=No
GlobalHistory=No
HistLogOn=No
LocalAliases=Yes
LocalDirHistory=Yes
LocalFunctions=Yes
LocalHistory=Yes

The defaults are for Global = Yes, Local = No. I have changed that to Global = No, Local = Yes

If I shift back to Global from Local in my TCMD.INI file, then the problem goes away in Windows Terminal Preview.

I often have multiple tabs for TCC in WT, and I like to have different history in each to scroll back through.
 
May 20, 2008
11,867
121
Syracuse, NY, USA
That's odd. I wouldn't expect any of those options to make a difference. All my GLobals are Yes and all my Locals are No and I don't see a problem. If I reverse all those settings I still don't see a problem.
 
May 30, 2022
31
0
Okay, forget everything I said previously, it appears that I was overlooking something. It now appears that the FIRST tab in Windows Terminal Preview exhibits the problem. I have things set so that any shell type application (TCC, CMD, Powershell, Powershell Preview, or Ubuntu Bash will open in Windows Terminal Preview. And whatever I start first has the problem that focus stays in that tab when a separate program is launched. Anything that I launch in a new, separate tab, does not have the problem.

I was misled by the fact that I always start TCC first, as it is my most used shell type application. From there, I start CMD or PowerShell, as needed, in a separate tab. My apologies for the confusion.
 
May 20, 2008
11,867
121
Syracuse, NY, USA
So WTP is your default console app handler (instead of conhost), right? I don't think I can do that with Windows 10 and not being an insider.

I've called attention in the WT forum to your post #18. They'll be interested.
 
May 30, 2022
31
0
I found the thread on Github, and posted a rather long winded explanation there. The problem is most definitely with WT preview, and not TCC.
 
May 20, 2008
11,867
121
Syracuse, NY, USA
@ohenryx, are you following on GitHub? You're report started quite a discussion, a new thread (most of which I don't understand), and apparently a fix.
 
May 30, 2022
31
0
Yes, I have been following the thread. Looks like they have a fix, but I'm guessing we will have to wait for the next preview release to see that fix. No big deal, just an annoyance. I kinda sorta understood in a vague way what they were discussing, but definitely not all of the details.
 
May 30, 2022
31
0
"This release of Windows Terminal Preview, 1.14.145, was made generally available on the 26th of May, 2022"

My version shows:
Windows Terminal Preview
Version: 1.14.1452.0

And it still has the bug.
 
May 30, 2022
31
0
Today there is a new version of Windows Terminal Preview available on the Store. 1.15.1863.0, and yes, it does fix this problem with focus.
 

Similar threads