Incompatibility with console programs #19473

Closed
opened 2026-01-31 06:44:22 +00:00 by claunia · 19 comments
Owner

Originally created by @v-python on GitHub (Feb 28, 2023).

Originally assigned to: @DHowett on GitHub.

Windows Terminal version

No response

Windows build number

No response

Other Software

Python 3.11.1

Steps to reproduce

I have a Python program that launches other programs, some are console programs, some are GUI, and then exits.

On Windows 10, using console, the python program (started from a GUI) initiates a console windows, writes a little info on the console, then launches the other program, and and exits. If the other program is a GUI, the console goes away quickly, and the GUI persists until the user exits. If the other program is a console program, it continues to use the console that is created for the Python program, even after the Python program exits.

This is all as expected and working fine.

However, I have all this stuff on Dropbox, and some of my users have upgraded to Windows 11, and it is not working fine. The case that is not working, is when the other program launched by the Python program is a console program. The other program dies "approximately concurrently" with the Python program. For debugging, I added a 5 minute timer at the point where the Python program would otherwise exit, and so it sticks around long enough to determine that it does, in fact, still launch the other program, and the other program is quite usable for 5 minutes... and then when the Python program timer expires and it exits, so does the other program.

Researching this eventually led me to the discovery that Windows Terminal is now the default for supplying console windows on Windows 11. I eventually discovered that there are some advanced settings regarding CloseOnExit for Windows Terminal: "graceful", "always", "never", true, false. I have little idea what really happens here, because I don't use Windows 11, I don't have Windows Terminal installed on Windows 10, I don't know if installing Windows Terminal on Windows 10 would result in the same behaviors, since I guess it wouldn't be the default? I don't really want to alter my working Windows 10 environment by experimenting. But I would expect that things should be compatible by default, and they aren't.

From what I can read, "CloseOnExit" may only concern itself with the immediate child process, and that could be the problem. From what I understand about Console, it closes when there are no processes still using it, allowing things to work as expected on Windows 10. Does Windows Terminal need a new "CloseOnExit" setting that means "Close when all programs using the tab have closed the tab"? Would that allow compatibility with Windows 10 Console? Shouldn't that be the default setting for Windows Terminal?

I found a screenshot of Windows Terminal CloseOnExit settings, and the list of settings was only 4, and while "never" mapped, I'm not sure what "automatic" in the screen shot corresponds to in the above list. "automatic" sounds good, but should wait for all users to close it, rather than process death. Or maybe there is some other setting I haven't found.

In any case, this seems to be an environmental incompatibility with Windows 10.

If I detect Windows 11 (which identifies as Windows 10, making that far harder than it should be), and have the Python program wait for its child, that leaves the annoying console open when the child is a GUI.

I have no idea what version of Windows 11 or Windows Terminal is being used on these other systems, but from what I know about the people involved, it is likely the automatic release channel, with updates being applied when available.

Expected Behavior

Program should be allow to run to completion in its parent's console.

Actual Behavior

Console programs terminate too early.

Originally created by @v-python on GitHub (Feb 28, 2023). Originally assigned to: @DHowett on GitHub. ### Windows Terminal version _No response_ ### Windows build number _No response_ ### Other Software Python 3.11.1 ### Steps to reproduce I have a Python program that launches other programs, some are console programs, some are GUI, and then exits. On Windows 10, using console, the python program (started from a GUI) initiates a console windows, writes a little info on the console, then launches the other program, and and exits. If the other program is a GUI, the console goes away quickly, and the GUI persists until the user exits. If the other program is a console program, it continues to use the console that is created for the Python program, even after the Python program exits. This is all as expected and working fine. However, I have all this stuff on Dropbox, and some of my users have upgraded to Windows 11, and it is not working fine. The case that is not working, is when the other program launched by the Python program is a console program. The other program dies "approximately concurrently" with the Python program. For debugging, I added a 5 minute timer at the point where the Python program would otherwise exit, and so it sticks around long enough to determine that it does, in fact, still launch the other program, and the other program is quite usable for 5 minutes... and then when the Python program timer expires and it exits, so does the other program. Researching this eventually led me to the discovery that Windows Terminal is now the default for supplying console windows on Windows 11. I eventually discovered that there are some advanced settings regarding CloseOnExit for Windows Terminal: "graceful", "always", "never", true, false. I have little idea what really happens here, because I don't use Windows 11, I don't have Windows Terminal installed on Windows 10, I don't know if installing Windows Terminal on Windows 10 would result in the same behaviors, since I guess it wouldn't be the default? I don't really want to alter my working Windows 10 environment by experimenting. But I would expect that things should be compatible by default, and they aren't. From what I can read, "CloseOnExit" may only concern itself with the immediate child process, and that could be the problem. From what I understand about Console, it closes when there are no processes still using it, allowing things to work as expected on Windows 10. Does Windows Terminal need a new "CloseOnExit" setting that means "Close when all programs using the tab have closed the tab"? Would that allow compatibility with Windows 10 Console? Shouldn't that be the default setting for Windows Terminal? I found a screenshot of Windows Terminal CloseOnExit settings, and the list of settings was only 4, and while "never" mapped, I'm not sure what "automatic" in the screen shot corresponds to in the above list. "automatic" sounds good, but should wait for all users to close it, rather than process death. Or maybe there is some other setting I haven't found. In any case, this seems to be an environmental incompatibility with Windows 10. If I detect Windows 11 (which identifies as Windows 10, making that far harder than it should be), and have the Python program wait for its child, that leaves the annoying console open when the child is a GUI. I have no idea what version of Windows 11 or Windows Terminal is being used on these other systems, but from what I know about the people involved, it is likely the automatic release channel, with updates being applied when available. ### Expected Behavior Program should be allow to run to completion in its parent's console. ### Actual Behavior Console programs terminate too early.
claunia added the Issue-BugNeeds-Tag-FixNeeds-Author-Feedback labels 2026-01-31 06:44:22 +00:00
Author
Owner

@DHowett commented on GitHub (Feb 28, 2023):

The first thing that comes to mind is the bugfix we took into 1.17 for this exact issue. I know that you didn't fill out the "Windows Terminal version" field because this came out of user reports for your project, but... it would be very helpful if you could find out what version they're from! 😄

The PR that we believe fixed this issue is #14544.

@DHowett commented on GitHub (Feb 28, 2023): The first thing that comes to mind is the bugfix we took into 1.17 for this exact issue. I know that you didn't fill out the "Windows Terminal version" field because this came out of user reports for your project, but... it would be very helpful if you could find out what version they're from! :smile: The PR that we believe fixed this issue is #14544.
Author
Owner

@DHowett commented on GitHub (Feb 28, 2023):

It looks like we may not have included that fix in 1.16 (the current GA version) because we were concerned about the risk. I can say with the hindsight of weeks that I now trust the fix enough to backport it.

If your users can test Terminal Preview 1.17, I'd be most grateful... 😁

@DHowett commented on GitHub (Feb 28, 2023): It looks like we may not have included that fix in 1.16 (the current GA version) because we were concerned about the risk. I can say with the hindsight of weeks that I now trust the fix enough to backport it. If your users can test Terminal Preview 1.17, I'd be most grateful... 😁
Author
Owner

@v-python commented on GitHub (Feb 28, 2023):

I'll see what I can find out, regarding version in use, and willingness to try the preview. Glad to know that I'm not the first to discover this, but it does seem surprising that something so basic was overlooked until version 17! Maybe we basic developers were happy enough with console that we didn't experiment with WT until it became the default on Win11.... I'm in USA, and my Win11 users in Europe, so it may take some time for communication, as well as installing. I've no clue if, as non-programmers, they'll be able to figure out how to install the preview. Is that available from the Win11 Store? Or only via Github?

@v-python commented on GitHub (Feb 28, 2023): I'll see what I can find out, regarding version in use, and willingness to try the preview. Glad to know that I'm not the first to discover this, but it does seem surprising that something so basic was overlooked until version 17! Maybe we basic developers were happy enough with console that we didn't experiment with WT until it became the default on Win11.... I'm in USA, and my Win11 users in Europe, so it may take some time for communication, as well as installing. I've no clue if, as non-programmers, they'll be able to figure out how to install the preview. Is that available from the Win11 Store? Or only via Github?
Author
Owner

@lhecker commented on GitHub (Mar 2, 2023):

Is that available from the Win11 Store? Or only via Github?

It's available via the store as well: https://www.microsoft.com/store/productId/9N8G5RFZ9XK3
Otherwise you can also use this special link to have it open directly as an install popup:

ms-windows-store://pdp/?ProductId=9N8G5RFZ9XK3&mode=mini
@lhecker commented on GitHub (Mar 2, 2023): > Is that available from the Win11 Store? Or only via Github? It's available via the store as well: https://www.microsoft.com/store/productId/9N8G5RFZ9XK3 Otherwise you can also use this special link to have it open directly as an install popup: ``` ms-windows-store://pdp/?ProductId=9N8G5RFZ9XK3&mode=mini ```
Author
Owner

@v-python commented on GitHub (Mar 10, 2023):

So one of my European users was able to use the links in the message above, install wt 1.17 Preview, and all is working, even after I disabled my workaround code.

The other user can't get it installed. Using the second link in the prior message takes him to a spot where it complains about the version of PowerShell. So he chose the zip download of PowerShell, and didn't know what to do after opening the ZIP file. So I suggested installing the new PowerShell from the store directly. After he did that, PowerShell starts up and says it is 7.3.3, but when he displayed the $PSVersionTable it says 5.1.22621.963. Is that really 7.3.3 identifying as 5.1, like Windows 11 identifies as version 10.0.... ? That business of not having a program pretend to be some other version is a total pain in the neck (and other places) when trying to understand what is happening. But because it shows 7.3.3 at startup, I suggested trying the wt install again.

But it again took him to the PowerShell upgrade page, instead of installing wt 1.17 preview.

Is there are process that will actually work? That users have a chance of understanding what to do next? Or it is there clear documentation on how to upgrade PowerShell? Is it really necessary to upgrade PowerShell to install wt? Why did one user not have any problem, and the other does? Is PowerShell 7.3.3 the current standard version? Is the 2nd user behind on Windows 11 updates, and the 1st user not?

@v-python commented on GitHub (Mar 10, 2023): So one of my European users was able to use the links in the message above, install wt 1.17 Preview, and all is working, even after I disabled my workaround code. The other user can't get it installed. Using the second link in the prior message takes him to a spot where it complains about the version of PowerShell. So he chose the zip download of PowerShell, and didn't know what to do after opening the ZIP file. So I suggested installing the new PowerShell from the store directly. After he did that, PowerShell starts up and says it is 7.3.3, but when he displayed the $PSVersionTable it says 5.1.22621.963. Is that really 7.3.3 identifying as 5.1, like Windows 11 identifies as version 10.0.... ? That business of not having a program pretend to be some other version is a total pain in the neck (and other places) when trying to understand what is happening. But because it shows 7.3.3 at startup, I suggested trying the wt install again. But it again took him to the PowerShell upgrade page, instead of installing wt 1.17 preview. Is there are process that will actually work? That users have a chance of understanding what to do next? Or it is there clear documentation on how to upgrade PowerShell? Is it really necessary to upgrade PowerShell to install wt? Why did one user not have any problem, and the other does? Is PowerShell 7.3.3 the current standard version? Is the 2nd user behind on Windows 11 updates, and the 1st user not?
Author
Owner

@zadjii-msft commented on GitHub (Mar 10, 2023):

Using the second link in the prior message takes him to a spot where it complains about the version of PowerShell

what? How exactly does it complain? The second link there is just a URI that deeplinks to the Windows Store app's page for Windows Terminal Preview. (The first link just goes to the web page version).

neither of those links should have anything to do with powershell. I have no idea how that second user could have gotten confused. You don't need to install PowerShell to install Terminal Preview. There's no dependency at all there.

Perhaps the second user got confused between

  • "Windows PowerShell" == powershell.exe == PowerShell v5.x
  • "PowerShell Core" == pwsh.exe == PowerShell 7.x

The "modern" powershell, v7, doesn't use powershell.exe anymore. Maybe that was part of the confusion?

To reiterate, there's no dependency between Windows Terminal and PowerShell.


ninja edit

maybe the second user clicked on the https://aka.ms/PSWindows link in the powershell.exe banner:
image

which again, is totally unrelated to the Terminal.

@zadjii-msft commented on GitHub (Mar 10, 2023): > Using the second link in the prior message takes him to a spot where it complains about the version of PowerShell _what_? How exactly does it complain? The second link there is just a URI that deeplinks to the Windows Store app's page for Windows Terminal Preview. (The first link just goes to the web page version). _neither_ of those links should have anything to do with powershell. I have no idea how that second user could have gotten confused. You don't need to install PowerShell to install Terminal Preview. There's no dependency at all there. Perhaps the second user got confused between * "Windows PowerShell" == `powershell.exe` == PowerShell v5.x * "PowerShell Core" == `pwsh.exe` == PowerShell 7.x The "modern" powershell, v7, doesn't use `powershell.exe` anymore. Maybe that was part of the confusion? To reiterate, there's no dependency between Windows Terminal and PowerShell. <hr> ninja edit maybe the second user clicked on the https://aka.ms/PSWindows link in the `powershell.exe` banner: ![image](https://user-images.githubusercontent.com/18356694/224438862-9c0cddd9-4698-4b29-94c4-9fb7c7a78a5f.png) which again, is totally unrelated to the Terminal.
Author
Owner

@v-python commented on GitHub (Mar 11, 2023):

So I never heard of PowerShell Core. He took some screen shots, so I will upload them, but I'm not sure what steps brought him to these screen shots. Here's what he said with it. Remember, I don't have Windows 11, so I don't know whether this is expected, unexpected, or how he got there... I'll paste what he said along with the screen shots.

Maybe I'll do the text and the associated screen shots
image
image
image

in separate postings, to try to avoid confusion. Here's the first:

I was able to download this preview version in the Store. See the first screenshot.

I opened it and got the second window.

I downloaded the Zip file, what I understood was the thing to do from the second screenshot.

Then I opened the ZIP and got all those files – see 3rd screenshot. What to do? No idea? I tried to open “createdump”, something happened, but I have no clue.

I did try twice to see if something has changed. rebooted my computer. But still the same.

So unfortunately I do not know what I am supposed to do.

@v-python commented on GitHub (Mar 11, 2023): So I never heard of PowerShell Core. He took some screen shots, so I will upload them, but I'm not sure what steps brought him to these screen shots. Here's what he said with it. Remember, I don't have Windows 11, so I don't know whether this is expected, unexpected, or how he got there... I'll paste what he said along with the screen shots. Maybe I'll do the text and the associated screen shots ![image](https://user-images.githubusercontent.com/2256941/225125311-3a70963f-45bb-4985-bd67-1d72172f1ff6.png) ![image](https://user-images.githubusercontent.com/2256941/225125688-615632c3-60e0-4993-ad84-38923b3fa2a9.png) ![image](https://user-images.githubusercontent.com/2256941/225125857-a0d7a353-c7fb-45d3-9f8f-2bbba15f73b2.png) in separate postings, to try to avoid confusion. Here's the first: I was able to download this preview version in the Store. See the first screenshot. I opened it and got the second window. I downloaded the Zip file, what I understood was the thing to do from the second screenshot. Then I opened the ZIP and got all those files – see 3rd screenshot. What to do? No idea? I tried to open “createdump”, something happened, but I have no clue. I did try twice to see if something has changed. rebooted my computer. But still the same. So unfortunately I do not know what I am supposed to do.
Author
Owner

@v-python commented on GitHub (Mar 11, 2023):

Here's the second. Not sure how the screen shots in the previous message got stuck where in the middle of a sentence describing them.

So I have tried again the link of the Microsoft message. The first one (I get the same if I go to Windows Store).

I get to the Window S-shot 7 (in English, so you understand)

“Get it in Store” opens a small Window (S-shot 9) So I open this

A Window (S-shot 11) opens:

install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

I klick on this https

The page in S-shot 12 opens.

Migrate from Windows PowerShell 5.1 to PowerShell 7

This is the page:

https://learn.microsoft.com/de-de/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.3

a little below, it says:

Installing PowerShell 7

For flexibility and to support the needs of IT and DevOps staff and developers, several options are available for installing PowerShell 7. In most cases, the installation options can be reduced to the following:

Deploy PowerShell with the MSI package.

Deploying PowerShell with the ZIP package

I tried to do the ZIP, then got all those files and this was too much for me. I did try one, but nothing happened. So I think this is where it ended for me.

Wonder if this is any help to you?
image
image
image
image

@v-python commented on GitHub (Mar 11, 2023): Here's the second. Not sure how the screen shots in the previous message got stuck where in the middle of a sentence describing them. So I have tried again the link of the Microsoft message. The first one (I get the same if I go to Windows Store). I get to the Window S-shot 7 (in English, so you understand) “Get it in Store” opens a small Window (S-shot 9) So I open this A Window (S-shot 11) opens: install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows I klick on this https The page in S-shot 12 opens. Migrate from Windows PowerShell 5.1 to PowerShell 7 This is the page: https://learn.microsoft.com/de-de/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.3 a little below, it says: Installing PowerShell 7 For flexibility and to support the needs of IT and DevOps staff and developers, several options are available for installing PowerShell 7. In most cases, the installation options can be reduced to the following: Deploy PowerShell with the MSI package. Deploying PowerShell with the ZIP package I tried to do the ZIP, then got all those files and this was too much for me. I did try one, but nothing happened. So I think this is where it ended for me. Wonder if this is any help to you? ![image](https://user-images.githubusercontent.com/2256941/225126092-98a64f89-a836-472b-bee5-fab1471826bf.png) ![image](https://user-images.githubusercontent.com/2256941/225126242-762ca577-7d14-4be0-8906-3a6278970045.png) ![image](https://user-images.githubusercontent.com/2256941/225126325-29e40396-4ee4-45af-aaa9-36c7f5b45f68.png) ![image](https://user-images.githubusercontent.com/2256941/225126518-a8c59310-54b2-42c6-a172-ceb7a468ced0.png)
Author
Owner

@v-python commented on GitHub (Mar 11, 2023):

Here is the third:

Thanks for your effort to help. I am not sure if I really got what I should get.

I did what you told me and I could use

Otherwise you can also use this special link to have it open directly as an install popup:

ms-windows-store://pdp/?ProductId=9N8G5RFZ9XK3&mode=mini


And I was able to install this.

Since I got the same page after that, I checked which version I have and it is still 5.1 (after a reboot). So I tried to do it again. But I am not able to do it again. Just a quick windows opens. And that’s it.

So I assume I am not able to install the latest version of Powershell. And I have to admit that this page is too complicated for me:

https://learn.microsoft.com/en-us/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.3

So unfortunately I am still at the same point. with powershell 5. (see screenshot)
image

@v-python commented on GitHub (Mar 11, 2023): Here is the third: Thanks for your effort to help. I am not sure if I really got what I should get. I did what you told me and I could use Otherwise you can also use this special link to have it open directly as an install popup: ms-windows-store://pdp/?ProductId=9N8G5RFZ9XK3&mode=mini — And I was able to install this. Since I got the same page after that, I checked which version I have and it is still 5.1 (after a reboot). So I tried to do it again. But I am not able to do it again. Just a quick windows opens. And that’s it. So I assume I am not able to install the latest version of Powershell. And I have to admit that this page is too complicated for me: https://learn.microsoft.com/en-us/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.3 So unfortunately I am still at the same point. with powershell 5. (see screenshot) ![image](https://user-images.githubusercontent.com/2256941/225126757-1ab2bf20-5d39-4951-9369-614893aa193c.png)
Author
Owner

@v-python commented on GitHub (Mar 11, 2023):

Here is the fourth:

ON this page, I tried to install the new version.

https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3#msi

And what does it say?

A newer version of PowerShell is already installed!!!

So I have no idea why it shows me the old version, when I check (screenshot in the last mail)

I also have tried this, see actual screenshot…

Rather confusing to me…
image

@v-python commented on GitHub (Mar 11, 2023): Here is the fourth: ON this page, I tried to install the new version. https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3#msi And what does it say? A newer version of PowerShell is already installed!!! So I have no idea why it shows me the old version, when I check (screenshot in the last mail) I also have tried this, see actual screenshot… Rather confusing to me… ![image](https://user-images.githubusercontent.com/2256941/225127063-479d303a-18f3-4de7-911c-630c548d6add.png)
Author
Owner

@v-python commented on GitHub (Mar 11, 2023):

I had suggested maybe the PowerShell had gotten installed since the screen shot has 7.3.3 in it so to try installing wt again....
Here is the fifth:
I was also wondering if I have PS7, as it said there. So I went to this link:

ms-windows-store://pdp/?ProductId=9N8G5RFZ9XK3&mode=mini

Microsoft store

I get to the PS, see screenshot

When I do open (öffnen), I get this page (as always before):

https://learn.microsoft.com/en-us/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.3

So still exactly at the same point.

Which means, I only have questions.
image

@v-python commented on GitHub (Mar 11, 2023): I had suggested maybe the PowerShell had gotten installed since the screen shot has 7.3.3 in it so to try installing wt again.... Here is the fifth: I was also wondering if I have PS7, as it said there. So I went to this link: ms-windows-store://pdp/?ProductId=9N8G5RFZ9XK3&mode=mini — Microsoft store I get to the PS, see screenshot When I do open (öffnen), I get this page (as always before): https://learn.microsoft.com/en-us/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.3 So still exactly at the same point. Which means, I only have questions. ![image](https://user-images.githubusercontent.com/2256941/225127423-8f8d23c6-1be1-4b45-bfc1-e69dd9742b7d.png)
Author
Owner

@v-python commented on GitHub (Mar 11, 2023):

My few interactions with Windows Store never led to this sort of confusion, so I don't know how to help.

I've never needed to install Windows Terminal, so I've never gone through the process.

I've no idea why PowerShell is involved.

I'm still running Windows 10... and I think I'll stay with it for a while longer, but it means I can't easily help my users who have bought new computers with buggy versions of Windows 11.

@v-python commented on GitHub (Mar 11, 2023): My few interactions with Windows Store never led to this sort of confusion, so I don't know how to help. I've never needed to install Windows Terminal, so I've never gone through the process. I've no idea why PowerShell is involved. I'm still running Windows 10... and I think I'll stay with it for a while longer, but it means I can't easily help my users who have bought new computers with buggy versions of Windows 11.
Author
Owner

@lhecker commented on GitHub (Mar 11, 2023):

I'm not sure how to best respond to the above, since there are many things worth responding to. In particular, there's 3 things I think need to be explained first:

Terminals

A "terminal", like Windows Terminal, is just a window that draws text. "Shells", like PowerShell or cmd.exe, are the actual interactive applications that present you the text inside the terminal. In layman terms, Windows Terminal is a browser and PowerShell is a website. We're just an empty window frame and we draw the text in the center when we're asked to. When PowerShell says

Installieren Sie die neueste PowerShell für neue Funktionen und Verbesserungen! https://aka.ms/PSWindows

then that's not us writing that message. That's PowerShell doing it and has nothing to do with the installation of Windows Terminal Preview anymore. You can see the same message with a different wording on your Windows 10 machine too. It says:

Lernen Sie das neue plattformübergreifende PowerShell kennen - https://aka.ms/pscore6

or in English, it'll say the equivalent:

Try the new cross-platform PowerShell https://aka.ms/pscore6

I'm a native German speaker and all 3 variants shown above read like regular advertising to me. After all, the message reads "install for new features!" and not "install required!". To be 100% frank, I'm quite surprised someone took it as part of the installation process. However I'm viewing this from the standpoint of a software engineer and so might have the people who wrote the message on the PowerShell team.

PowerShell

The above aside, there have been 7 major versions of PowerShell so far, but after version 5 they split into two "variants":

  • "Windows PowerShell" with the executable name powershell.exe is the one with the blue icon, seen above in your screenshots. It ships by default with both Windows 10 and 11 in version 5.1.
  • "PowerShell" (also called "PowerShell Core") with the executable name pwsh.exe is the one with the dark blue (!) icon. Its version is 6 and later and it doesn't come preinstalled. Users can choose to install it if they wish to do so.

image

This split occurred, because... This split occurred, because pwsh.exe is built on a different .NET platform than powershell.exe, allowing the PowerShell team to make it cross-platform. Unfortunately this caused pwsh.exe to be incompatible with various things that only powershell.exe can, which is why powershell.exe remains installed by default and pwsh.exe doesn't. But with each year the two are getting closer so I'm personally expecting that powershell.exe will be replaced by pwsh.exe by default at some point in the future.

You can have multiple versions of PowerShell installed at the same time and they do not conflict with each other. So if you install PowerShell 7, this does not uninstall PowerShell 5. It's like having multiple versions of Python installed.

Windows Terminal

When you first launch Windows Terminal, we'll determine the newest version of PowerShell you have installed and use that as your default shell when you open a new tab. If you install Windows Terminal, while PowerShell 7 (aka pwsh.exe) is not installed, and only then install PowerShell 7, we'll not switch this default choice, because doing so would be a bit surprising. But that doesn't mean it's not there:

image

If you press Ctrl+, or click on the "Settings" item in that same menu, you can change your selection at any time ("profiles" are basically "shells with terminal settings" for us):

image


With the above as context, I'll now try to respond to your initial questions/comments:

The other user can't get it installed. Using the second link in the prior message takes him to a spot where it complains about the version of PowerShell.
[...]
But it again took him to the PowerShell upgrade page, instead of installing wt 1.17 preview.

If you think it would be helpful you could forward my explanation about the difference between a terminal and a shell to that person ("terminal/shell" = "browser/website"). The store link (ms-windows-store://pdp/?ProductId=9N8G5RFZ9XK3&mode=mini) allowed the user to install Windows Terminal and the content, provided by PowerShell, is then unrelated.

I hope I'm not rude when saying this, but as an aside I feel like it's probably a good idea in general to remind this user to never trust what any application says, even if it appears like an application from Microsoft (it could be infected after all), especially when it tells you to download and run executables from the internet that one doesn't know well (it could definitely be infected). I mean everyone in this thread knows and understands these messages and we know to double-check the domain names of sites and how to spot fake software, but I get the feeling that this person isn't as familiar with computers and should be more cautious in the future and choose to ignore such messages entirely (or at least carefully consider).

After he did that, PowerShell starts up and says it is 7.3.3, but when he displayed the $PSVersionTable it says 5.1.22621.963.

PowerShell will never fake the PSVersion in the $PSVersionTable output. The user must've most likely started PowerShell, closed it and then opened Windows Terminal again. Since the user first installed Windows Terminal and only then PowerShell 7, they'll continue to get PowerShell 5 as the default shell, as I explained above. The icons will look different and you can change the default shell ("profile") in the settings.

Is it really necessary to upgrade PowerShell to install wt?

No, you don't need to! Especially if you only need to run a Python application, as it doesn't depend on the installed PowerShell version at all. PowerShell 5 is still maintained and completely fine for this purpose.


I hope this answers your questions! Let me know if I left anything else unanswered, or if you have any more questions. 🙂

@lhecker commented on GitHub (Mar 11, 2023): I'm not sure how to best respond to the above, since there are many things worth responding to. In particular, there's 3 things I think need to be explained first: ### Terminals A "terminal", like Windows Terminal, is just a window that draws text. "Shells", like PowerShell or cmd.exe, are the actual interactive applications that present you the text inside the terminal. In layman terms, Windows Terminal is a browser and PowerShell is a website. We're just an empty window frame and we draw the text in the center when we're asked to. When PowerShell says > Installieren Sie die neueste PowerShell für neue Funktionen und Verbesserungen! https://aka.ms/PSWindows then that's not us writing that message. That's PowerShell doing it and has nothing to do with the installation of Windows Terminal Preview anymore. You can see the same message with a different wording on your Windows 10 machine too. It says: > Lernen Sie das neue plattformübergreifende PowerShell kennen - https://aka.ms/pscore6 or in English, it'll say the equivalent: > Try the new cross-platform PowerShell https://aka.ms/pscore6 I'm a native German speaker and all 3 variants shown above read like regular advertising to me. After all, the message reads "install for new features!" and not "install required!". To be 100% frank, I'm quite surprised someone took it as part of the installation process. However I'm viewing this from the standpoint of a software engineer and so might have the people who wrote the message on the PowerShell team. ### PowerShell The above aside, there have been 7 major versions of PowerShell so far, but after version 5 they split into two "variants": * "Windows PowerShell" with the executable name `powershell.exe` is the one with the blue icon, seen above in your screenshots. It ships by default with both Windows 10 and 11 in version `5.1`. * "PowerShell" (also called "PowerShell Core") with the executable name `pwsh.exe` is the one with the **dark blue** (!) icon. Its version is `6` and later and it doesn't come preinstalled. Users can choose to install it if they wish to do so. ![image](https://user-images.githubusercontent.com/2256941/224495544-facacb2f-93fa-4c58-8b5a-4c0489f2b026.png) <details> <summary>This split occurred, because...</summary> This split occurred, because <code>pwsh.exe</code> is built on a different .NET platform than <code>powershell.exe</code>, allowing the PowerShell team to make it cross-platform. Unfortunately this caused <code>pwsh.exe</code> to be incompatible with various things that only <code>powershell.exe</code> can, which is why <code>powershell.exe</code> remains installed by default and <code>pwsh.exe</code> doesn't. But with each year the two are getting closer so I'm personally expecting that <code>powershell.exe</code> will be replaced by <code>pwsh.exe</code> by default at some point in the future. </details> You can have multiple versions of PowerShell installed at the same time and they do not conflict with each other. So if you install PowerShell 7, this does not uninstall PowerShell 5. It's like having multiple versions of Python installed. ### Windows Terminal When you first launch Windows Terminal, we'll determine the newest version of PowerShell you have installed and use that as your default shell when you open a new tab. If you install Windows Terminal, while PowerShell 7 (aka `pwsh.exe`) is not installed, and only then install PowerShell 7, we'll not switch this default choice, because doing so would be a bit surprising. But that doesn't mean it's not there: ![image](https://user-images.githubusercontent.com/2256941/224495092-9a621c41-7c99-4cc3-964a-7871a435eed6.png) If you press Ctrl+, or click on the "Settings" item in that same menu, you can change your selection at any time ("profiles" are basically "shells with terminal settings" for us): ![image](https://user-images.githubusercontent.com/2256941/224495155-cee9ef75-15da-4531-82d2-46a2309c2cec.png) --- With the above as context, I'll now try to respond to your initial questions/comments: > The other user can't get it installed. Using the second link in the prior message takes him to a spot where it complains about the version of PowerShell. > [...] > But it again took him to the PowerShell upgrade page, instead of installing wt 1.17 preview. If you think it would be helpful you could forward my explanation about the difference between a terminal and a shell to that person ("terminal/shell" = "browser/website"). The store link (`ms-windows-store://pdp/?ProductId=9N8G5RFZ9XK3&mode=mini`) allowed the user to install Windows Terminal and the content, provided by PowerShell, is then unrelated. I hope I'm not rude when saying this, but as an aside I feel like it's probably a good idea in general to remind this user to never trust what any application says, even if it appears like an application from Microsoft (it could be infected after all), especially when it tells you to download and run executables from the internet that one doesn't know well (it could definitely be infected). I mean everyone in this thread knows and understands these messages and we know to double-check the domain names of sites and how to spot fake software, but I get the feeling that this person isn't as familiar with computers and should be more cautious in the future and choose to ignore such messages entirely (or at least carefully consider). > After he did that, PowerShell starts up and says it is 7.3.3, but when he displayed the $PSVersionTable it says 5.1.22621.963. PowerShell will never fake the `PSVersion` in the `$PSVersionTable` output. The user must've most likely started PowerShell, closed it and then opened Windows Terminal again. Since the user first installed Windows Terminal and only then PowerShell 7, they'll continue to get PowerShell 5 as the default shell, as I explained above. The icons will look different and you can change the default shell ("profile") in the settings. > Is it really necessary to upgrade PowerShell to install wt? No, you don't need to! Especially if you only need to run a Python application, as it doesn't depend on the installed PowerShell version at all. PowerShell 5 is still maintained and completely fine for this purpose. --- I hope this answers your questions! Let me know if I left anything else unanswered, or if you have any more questions. 🙂
Author
Owner

@v-python commented on GitHub (Mar 11, 2023):

I highly appreciate all of your response.

OK, I don't speak German, and my second user freely admits that technology sometimes baffles him.

So you can see this user's confusion resulting from Microsoft putting irrelevant advertising messages in products that are somehow used during the installation process.

And you can, hopefully, understand why I wouldn't have a clue whether or not to trust the version information from Powershell or Windows Terminal, or any other Microsoft-written software, when it took me two days to figure out that Windows 11 was advertising itself as Windows 10.0, and how to figure out what version of Windows my programs are really running on. This is extremely confusing. And that follows after I spent a couple days trying to figure out why things worked differently for these users than for me, since one hopes that Windows 11 is upward compatible with Windows 10, but I finally stumbled across an article mentioning the switch in default console applications in a recent Windows 11 upgrade, which turned out to this root cause of the problem, because these users had been running my software successfully on Windows 11 prior to that switch in default to the buggy Windows Terminal.

Do you think that the 2nd user actually successfully installed Windows Terminal 1.17 Preview in the midst of all those screen shots and messages?

How can I determine the accurate version of Windows Terminal that he is running? And I apologize in advance for not searching for this answer before asking the question here, because I really don't want to spend days more looking for an obscure method like that that has to be used to determine the real version of Windows.

If you don't think the user has actually installed wt 1.17, what does he need to do to finish the process?

@v-python commented on GitHub (Mar 11, 2023): I highly appreciate all of your response. OK, I don't speak German, and my second user freely admits that technology sometimes baffles him. So you can see this user's confusion resulting from Microsoft putting irrelevant advertising messages in products that are somehow used during the installation process. And you can, hopefully, understand why I wouldn't have a clue whether or not to trust the version information from Powershell or Windows Terminal, or any other Microsoft-written software, when it took me two days to figure out that Windows 11 was advertising itself as Windows 10.0, and how to figure out what version of Windows my programs are really running on. This is extremely confusing. And that follows after I spent a couple days trying to figure out why things worked differently for these users than for me, since one hopes that Windows 11 is upward compatible with Windows 10, but I finally stumbled across an article mentioning the switch in default console applications in a recent Windows 11 upgrade, which turned out to this root cause of the problem, because these users had been running my software successfully on Windows 11 prior to that switch in default to the buggy Windows Terminal. Do you think that the 2nd user actually successfully installed Windows Terminal 1.17 Preview in the midst of all those screen shots and messages? How can I determine the accurate version of Windows Terminal that he is running? And I apologize in advance for not searching for this answer before asking the question here, because I really don't want to spend days more looking for an obscure method like that that has to be used to determine the real version of Windows. If you don't think the user has actually installed wt 1.17, what does he need to do to finish the process?
Author
Owner

@v-python commented on GitHub (Mar 11, 2023):

OK, so I find these instructions to get Windows Terminal version, my 2nd user followed them, and has version 1.16.10262. Is that The 1.17 Preview? I think not, because my software still doesn't work for him.

So his very first message shows that he does get to the store, clicks the "Öffnen" button, and that takes him to Powershell, rather than installing Windows Terminal Preview. In English, "Get" and "Open" are not synonyms, but I don't speak German (but I can use Google translate). So is the "Öffnen" button supposed to do the install, in the German version? And if it is supposed to, why does it seem to instead open Powershell?

@v-python commented on GitHub (Mar 11, 2023): OK, so I find these instructions to get Windows Terminal version, my 2nd user followed them, and has version 1.16.10262. Is that The 1.17 Preview? I think not, because my software still doesn't work for him. So his very first message shows that he does get to the store, clicks the "Öffnen" button, and that takes him to Powershell, rather than installing Windows Terminal Preview. In English, "Get" and "Open" are not synonyms, but I don't speak German (but I can use Google translate). So is the "Öffnen" button supposed to do the install, in the German version? And if it is supposed to, why does it seem to instead open Powershell?
Author
Owner

@lhecker commented on GitHub (Mar 12, 2023):

Do you think that the 2nd user actually successfully installed Windows Terminal 1.17 Preview in the midst of all those screen shots and messages?

I'm not 100% sure which images refer to which users, but the difference between Windows Terminal and Windows Terminal Preview is easy to spot. The Preview version is the one that has the blue "PRE" label in the taskbar icon:
image

Some of your screenshots show the Preview version, but 2 screenshots show the non-Preview version. In particular your comments starting with "Here is the third" and "Here is the fourth" show the non-Preview version.

I suspect this most likely because the user ran "PowerShell" from the start menu. This will open Windows Terminal (non-Preview). If you want to run the Preview version you have to run it explicitly and not PowerShell.

How can I determine the accurate version of Windows Terminal that he is running?

If the above way by looking at the taskbar icon is not sufficient, you can determine the version number by opening the About menu:
image

[...] my 2nd user followed them, and has version 1.16.10262. Is that The 1.17 Preview?

No. You should ask them run "Windows Terminal Preview" from the start menu and not just run "PowerShell" (which is what I suspect they're doing). Running "PowerShell" from the start menu will run the default terminal application which is "Windows Terminal" (without the Preview). Alternatively they might be accidentially clicking the non-Preview version in the start menu? But I suppose that's less likely, given the other things you've stated.

So his very first message shows that he does get to the store, clicks the "Öffnen" button, and that takes him to Powershell, rather than installing Windows Terminal Preview.

If they have the store page open, the one I can see in your screenshots above, and they click on "Öffnen", they'll definitely open Windows Terminal Preview. PowerShell is the thing that runs inside Windows Terminal and not the other way around.

I believe that statement stems from the user fundamentally misunderstanding what a terminal is. Once again, I'd like to provide the "browser vs. website" analogy: When the user clicks "Öffnen" it'll without fail open Windows Terminal Preview (the "browser"). It then "connects" to PowerShell (the "website") which will in turn provide the interactive text content in the center. Having both Windows Terminal and Windows Terminal Preview installed is like having 2 browsers installed, but the website (PowerShell) is the same.
Opening the Preview version through the store looks like the non-Preview version was opened, because both look mostly identical aside from the taskbar icon. But that doesn't mean that either of them is PowerShell. No, they're just a window frame that draws text when asked to.

Just to be clear, this is also true on Windows 10 for you. There's a reason why every terminal application gets the exact same window frame and title bar context menu. It's because conhost.exe is Windows 10's default terminal and the above analogy works the exact same way there.
image

@lhecker commented on GitHub (Mar 12, 2023): > Do you think that the 2nd user actually successfully installed Windows Terminal 1.17 Preview in the midst of all those screen shots and messages? I'm not 100% sure which images refer to which users, but the difference between Windows Terminal and Windows Terminal Preview is easy to spot. The Preview version is the one that has the blue "PRE" label in the taskbar icon: ![image](https://user-images.githubusercontent.com/2256941/224561387-3efa1962-3434-4de9-9162-f84ace2c67a6.png) Some of your screenshots show the Preview version, but 2 screenshots show the non-Preview version. In particular your comments starting with ["Here is the third"](https://github.com/microsoft/terminal/issues/14929#issuecomment-1464733171) and ["Here is the fourth"](https://github.com/microsoft/terminal/issues/14929#issuecomment-1464733898) show the non-Preview version. I suspect this most likely because the user ran "PowerShell" from the start menu. This will open Windows Terminal (non-Preview). If you want to run the Preview version you have to run it explicitly and not PowerShell. > How can I determine the accurate version of Windows Terminal that he is running? If the above way by looking at the taskbar icon is not sufficient, you can determine the version number by opening the About menu: ![image](https://user-images.githubusercontent.com/2256941/224561904-aadb77f1-64a1-4872-a926-8b4415c0bf5b.png) > [...] my 2nd user followed them, and has version 1.16.10262. Is that The 1.17 Preview? No. You should ask them run "Windows Terminal Preview" from the start menu and not just run "PowerShell" (which is what I suspect they're doing). Running "PowerShell" from the start menu will run the default terminal application which is "Windows Terminal" (without the Preview). Alternatively they might be accidentially clicking the non-Preview version in the start menu? But I suppose that's less likely, given the other things you've stated. > So his very first message shows that he does get to the store, clicks the "Öffnen" button, and that takes him to Powershell, rather than installing Windows Terminal Preview. If they have the store page open, the one I can see in your screenshots above, and they click on "Öffnen", they'll definitely open Windows Terminal Preview. PowerShell is the thing that runs _inside_ Windows Terminal and not the other way around. I believe that statement stems from the user fundamentally misunderstanding what a terminal is. Once again, I'd like to provide the "browser vs. website" analogy: When the user clicks "Öffnen" it'll without fail open Windows Terminal Preview (the "browser"). It then "connects" to PowerShell (the "website") which will in turn provide the interactive text content in the center. Having both Windows Terminal and Windows Terminal Preview installed is like having 2 browsers installed, but the website (PowerShell) is the same. Opening the Preview version through the store looks like the non-Preview version was opened, because both look mostly identical aside from the taskbar icon. But that doesn't mean that either of them **is** PowerShell. No, they're just a window frame that draws text when asked to. Just to be clear, this is also true on Windows 10 for you. There's a reason why every terminal application gets the exact same window frame and title bar context menu. It's because `conhost.exe` is Windows 10's default terminal and the above analogy works the exact same way there. ![image](https://user-images.githubusercontent.com/2256941/224562956-08748c4e-f795-4864-9ba8-7adc5d8e7815.png)
Author
Owner

@v-python commented on GitHub (Mar 12, 2023):

OK, so I wasn't clear on whether 1.16 and 1.17 can coexist (you described that multiple versions of Powershell can). But does opening it once from the store keep it installed on the system?

And if both versions are there, no console or terminal windows are open, and the user starts AutoHotKey (a GUI app), and it launches Python (a console app), does it get wt 1.16 or 1.17?

And if wt 1.17 preview is already open, does that change what happens above?

And if the first answer is 1.16, how to make it get 1.17 by default?

And yes, it might work the same way on my Windows 10, if I would install wt on Windows 10, and if I would launch Powershell. But I've been quite content to use CMD and conhost. They work for what I need.

I do understand what you are saying about wt vs powershell, but I'm really ont sure my 2nd user does, nor am I sure why the 1st user, having installed wt 1.17 Preview, isn't having any problems using it by default, if both it and wt 1.16 are still installed on her system.

@v-python commented on GitHub (Mar 12, 2023): OK, so I wasn't clear on whether 1.16 and 1.17 can coexist (you described that multiple versions of Powershell can). But does opening it once from the store keep it installed on the system? And if both versions are there, no console or terminal windows are open, and the user starts AutoHotKey (a GUI app), and it launches Python (a console app), does it get wt 1.16 or 1.17? And if wt 1.17 preview is already open, does that change what happens above? And if the first answer is 1.16, how to make it get 1.17 by default? And yes, it might work the same way on my Windows 10, if I would install wt on Windows 10, and if I would launch Powershell. But I've been quite content to use CMD and conhost. They work for what I need. I do understand what you are saying about wt vs powershell, but I'm really ont sure my 2nd user does, nor am I sure why the 1st user, having installed wt 1.17 Preview, isn't having any problems using it by default, if both it and wt 1.16 are still installed on her system.
Author
Owner

@lhecker commented on GitHub (Mar 12, 2023):

OK, so I wasn't clear on whether 1.16 and 1.17 can coexist (you described that multiple versions of Powershell can).

It's not that 1.16 and 1.17 can coexist, but rather that "Windows Terminal" and "Windows Terminal Preview" are two different applications.

But does opening it once from the store keep it installed on the system?

Yes, until you uninstall it.

And if both versions are there, no console or terminal windows are open, and the user starts AutoHotKey (a GUI app), and it launches Python (a console app), does it get wt 1.16 or 1.17?

Windows Terminal (1.16). You can change the default terminal in the settings:
image

Alternatively you can uninstall Windows Terminal (1.16) so that only the Preview version remains. This has the same effect.

It might be important to note here, that launching a console application inside a running Windows Terminal instance - be it Preview or not - will generally not (!) launch a new Windows Terminal instance. Basically, if I had access to your Python application, and were to run it directly from inside Windows Terminal Preview, your application will continue running inside Windows Terminal Preview, even if Windows Terminal is the default terminal application. In other words, terminal sessions are kind of "sticky" in a sense.

And if wt 1.17 preview is already open, does that change what happens above?

No, every new console application you launch is treated individually from the rest. (But Windows Terminal is highly configurable, so you can optionally ask it to move newly launched console applications into an already open window - this is also an option in the settings.)

And yes, it might work the same way on my Windows 10, if I would install wt on Windows 10, and if I would launch Powershell.

While Windows Terminal exists on Windows 10, newly launched console applications, like your Python application, will only launch in the conhost (old console) window. We only got approval to backport this particular functionality to Windows 10 very recently and it hasn't arrived in Windows 10 yet.

I do understand what you are saying about wt vs powershell, but I'm really ont sure my 2nd user does, nor am I sure why the 1st user, having installed wt 1.17 Preview, isn't having any problems using it by default, if both it and wt 1.16 are still installed on her system.

Frankly, I suspect they looked at the settings and/or just did the above themselves. 😅 In particular changing the "Default Terminal application" setting, which is normally not required (hence went unmentioned so far), but if your application is launched by AutoHotKey then it is required.

@lhecker commented on GitHub (Mar 12, 2023): > OK, so I wasn't clear on whether 1.16 and 1.17 can coexist (you described that multiple versions of Powershell can). It's not that 1.16 and 1.17 can coexist, but rather that "Windows Terminal" and "Windows Terminal Preview" are two different applications. > But does opening it once from the store keep it installed on the system? Yes, until you uninstall it. > And if both versions are there, no console or terminal windows are open, and the user starts AutoHotKey (a GUI app), and it launches Python (a console app), does it get wt 1.16 or 1.17? Windows Terminal (1.16). You can change the default terminal in the settings: ![image](https://user-images.githubusercontent.com/2256941/224573088-e3b78597-856a-460e-a87d-4c734bc7b7cb.png) Alternatively you can uninstall Windows Terminal (1.16) so that only the Preview version remains. This has the same effect. It might be important to note here, that launching a console application _inside_ a running Windows Terminal instance - be it Preview or not - will generally not (!) launch a new Windows Terminal instance. Basically, if I had access to your Python application, and were to run it directly from inside Windows Terminal Preview, your application will continue running inside Windows Terminal Preview, even if Windows Terminal is the default terminal application. In other words, terminal sessions are kind of "sticky" in a sense. > And if wt 1.17 preview is already open, does that change what happens above? No, every new console application you launch is treated individually from the rest. (But Windows Terminal is highly configurable, so you can optionally ask it to move newly launched console applications into an already open window - this is also an option in the settings.) > And yes, it might work the same way on my Windows 10, if I would install wt on Windows 10, and if I would launch Powershell. While Windows Terminal exists on Windows 10, newly launched console applications, like your Python application, will only launch in the `conhost` (old console) window. We only got approval to backport this particular functionality to Windows 10 very recently and it hasn't arrived in Windows 10 yet. > I do understand what you are saying about wt vs powershell, but I'm really ont sure my 2nd user does, nor am I sure why the 1st user, having installed wt 1.17 Preview, isn't having any problems using it by default, if both it and wt 1.16 are still installed on her system. Frankly, I suspect they looked at the settings and/or just did the above themselves. 😅 In particular changing the "Default Terminal application" setting, which is normally not required (hence went unmentioned so far), but if your application is launched by AutoHotKey then it is required.
Author
Owner

@v-python commented on GitHub (Mar 13, 2023):

OK, that clears things up for me, so I think I can get my 2nd user going. And for curiosity, I'll ask the 1st user what settings she changed, or if she uninstalled wt 1.16

@v-python commented on GitHub (Mar 13, 2023): OK, that clears things up for me, so I think I can get my 2nd user going. And for curiosity, I'll ask the 1st user what settings she changed, or if she uninstalled wt 1.16
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19473