Terminal closes on startup due to "specified command or file was not found" in Powershell #7742

Open
opened 2026-01-31 01:11:38 +00:00 by claunia · 0 comments
Owner

Originally created by @izackp on GitHub (Apr 28, 2020).

WindowsTerminal_2020-04-27_23-44-14

Environment

Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0
I can find no startup scripts for powershell

Steps to reproduce

Open Windows Terminal

Expected behavior

See Terminal and a powershell tab

Actual behavior

Powershell reports an error, returns 0, then instantly closes the entire app. It shows the error:

Could not execute because the specified command or file was not found.
Possible reasons for this include:

  • You misspelled a built-in dotnet command.
  • You intended to execute a .NET Core program, but dotnet-C:\Users\Isaac does not exist.
  • You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

I think its because there is a space in my windows username. However, I have no idea why powershell is trying to execute a command on start up in the first place. Everything seems to start up fine when I open powershell outside of windows terminal. I'm not really sure how to further diagnose this issue. It took a while just to figure out how to keep windows terminal from closing (running wt.exe with bad parameters let me run it and keep it from closing).

Either way, powershell instantly shutting down the app is a bad user experience.

Originally created by @izackp on GitHub (Apr 28, 2020). ![WindowsTerminal_2020-04-27_23-44-14](https://user-images.githubusercontent.com/2636382/80444976-1f28ad00-88e1-11ea-8284-d313865393e3.png) # Environment Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0 I can find no startup scripts for powershell # Steps to reproduce Open Windows Terminal # Expected behavior See Terminal and a powershell tab # Actual behavior Powershell reports an error, returns 0, then instantly closes the entire app. It shows the error: Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET Core program, but dotnet-C:\Users\Isaac does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. I think its because there is a space in my windows username. However, I have no idea why powershell is trying to execute a command on start up in the first place. Everything seems to start up fine when I open powershell outside of windows terminal. I'm not really sure how to further diagnose this issue. It took a while just to figure out how to keep windows terminal from closing (running wt.exe with bad parameters let me run it and keep it from closing). Either way, powershell instantly shutting down the app is a bad user experience.
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 01:11:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7742