Error 0x8007010b could display a more expressive error message - mention the actual starting directory? #12509

Closed
opened 2026-01-31 03:17:31 +00:00 by claunia · 9 comments
Owner

Originally created by @erichiller on GitHub (Feb 11, 2021).

Environment

Windows build number:  Win32NT             10.0.19042.0 Microsoft Windows NT 10.0.19042.0
Windows Terminal version (if applicable):  Version: 1.6.10272.0

I've had this happen on the both the windows computers I use, but the above is from the machine I use most. This did use to work, and I haven't changed anything in my setup recently (besides the windows version though normal updates and terminal versions). Unknown how long this has been broken for me, but at least 1.5 weeks.

profiles in settings.json:


            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44ff}",
                "name": "Windows PowerShell 7.2-preview",
                "commandline": "pwsh.exe",
                "hidden": false,
                "background": "#000000",
                "colorScheme": "Tango Dark",
                "cursorColor": "#FFFFFF",
                "cursorShape": "bar",
                "fontSize": 8,
                "icon": "C:\\Program Files\\PowerShell\\7-preview\\assets\\Powershell_av_colors.ico",
                "historySize": 9999,
                "startingDirectory": "~/",
                "snapOnInput": true
            }

Steps to reproduce

Use the duplicateTab command for a hotkey.
eg.

        {
            "command": "duplicateTab",
            "keys": [
                "ctrl+up"
            ]
        },

Expected behavior

A tab to open of the same type as the current tab.

Actual behavior

I receive an error like

[error 0x8007010b when launching `pwsh.exe']

image

Originally created by @erichiller on GitHub (Feb 11, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Win32NT 10.0.19042.0 Microsoft Windows NT 10.0.19042.0 Windows Terminal version (if applicable): Version: 1.6.10272.0 ``` I've had this happen on the both the windows computers I use, but the above is from the machine I use most. This did use to work, and I haven't changed anything in my setup recently (besides the windows version though normal updates and terminal versions). Unknown how long this has been broken for me, but at least 1.5 weeks. `profiles` in `settings.json`: ```json { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44ff}", "name": "Windows PowerShell 7.2-preview", "commandline": "pwsh.exe", "hidden": false, "background": "#000000", "colorScheme": "Tango Dark", "cursorColor": "#FFFFFF", "cursorShape": "bar", "fontSize": 8, "icon": "C:\\Program Files\\PowerShell\\7-preview\\assets\\Powershell_av_colors.ico", "historySize": 9999, "startingDirectory": "~/", "snapOnInput": true } ``` # Steps to reproduce Use the `duplicateTab` command for a hotkey. eg. ```json { "command": "duplicateTab", "keys": [ "ctrl+up" ] }, ``` # Expected behavior A tab to open of the same type as the current tab. # Actual behavior I receive an error like ``` [error 0x8007010b when launching `pwsh.exe'] ``` ![image](https://user-images.githubusercontent.com/5379325/107635229-08610600-6c28-11eb-8d07-7fb0b2213546.png)
Author
Owner

@zadjii-msft commented on GitHub (Feb 11, 2021):

I'm betting something in your prompt is emitting OSC 9;9 to "set the current directory", and we're failing to find that directory. This might be the same root cause as #8930, which was fixed by #8934. Could you do a gc function:/Prompt and share what that outputs? We might be able to find the offending quotes in that output.

We might also be able to surface this particular error better. @DHowett thoughts on having this specific error cause the connection to tell the user which directory wasn't found?

@zadjii-msft commented on GitHub (Feb 11, 2021): I'm betting something in your prompt is emitting OSC 9;9 to "set the current directory", and we're failing to find that directory. This might be the same root cause as #8930, which was fixed by #8934. Could you do a `gc function:/Prompt` and share what that outputs? We might be able to find the offending quotes in that output. We might also be able to surface this particular error better. @DHowett thoughts on having this specific error cause the connection to tell the user _which directory_ wasn't found?
Author
Owner

@JasonWThompson commented on GitHub (Feb 11, 2021):

I noticed my issue that I logged is similar to this one. Here is what I get when I run that command.

 gc function:/Prompt

        $lastCommandFailed = ($global:error.Count -gt $sl.ErrorCount) -or -not $?
        $sl.ErrorCount = $global:error.Count

        #Start the vanilla posh-git when in a vanilla window, else: go nuts
        if(Test-IsVanillaWindow) {
            Write-Host -Object ($pwd.ProviderPath) -NoNewline
            Write-VcsStatus
        }

        Reset-CursorPosition
        $prompt = (Write-Theme -lastCommandFailed $lastCommandFailed)

        if($sl.Options.ConsoleTitle) {
            $location = Get-Location
            $folder = (Get-ChildItem | Select-Object -First 1).Parent.BaseName
            $prompt += "$([char]27)]2;$($folder)$([char]7)"
            if ($location.Provider.Name -eq "FileSystem") {
                $prompt += "$([char]27)]9;9;`"$($location.Path)`"$([char]7)"
            }
        }

        $prompt

I set this custom prompt months ago from a tutorial. I'll see if I can find the tutorial and undo the change.

@JasonWThompson commented on GitHub (Feb 11, 2021): I noticed my issue that I logged is similar to this one. Here is what I get when I run that command. ``` gc function:/Prompt $lastCommandFailed = ($global:error.Count -gt $sl.ErrorCount) -or -not $? $sl.ErrorCount = $global:error.Count #Start the vanilla posh-git when in a vanilla window, else: go nuts if(Test-IsVanillaWindow) { Write-Host -Object ($pwd.ProviderPath) -NoNewline Write-VcsStatus } Reset-CursorPosition $prompt = (Write-Theme -lastCommandFailed $lastCommandFailed) if($sl.Options.ConsoleTitle) { $location = Get-Location $folder = (Get-ChildItem | Select-Object -First 1).Parent.BaseName $prompt += "$([char]27)]2;$($folder)$([char]7)" if ($location.Provider.Name -eq "FileSystem") { $prompt += "$([char]27)]9;9;`"$($location.Path)`"$([char]7)" } } $prompt ``` I set this custom prompt months ago from a tutorial. I'll see if I can find the tutorial and undo the change.
Author
Owner

@DHowett commented on GitHub (Feb 11, 2021):

There's a build of Terminal about to come out that should fix this. Sorry for the issue! 😄

@DHowett commented on GitHub (Feb 11, 2021): There's a build of Terminal about to come out that should fix this. Sorry for the issue! :smile:
Author
Owner

@DHowett commented on GitHub (Feb 11, 2021):

thoughts on having this specific error cause the connection to tell the user which directory wasn't found?

I would love to have more expressive error messages !

@DHowett commented on GitHub (Feb 11, 2021): >thoughts on having this specific error cause the connection to tell the user which directory wasn't found? I would love to have more expressive error messages !
Author
Owner

@zadjii-msft commented on GitHub (Feb 11, 2021):

I'm gonna leave this open then and re-purpose this as "we need a more expressive message in this case".

@zadjii-msft commented on GitHub (Feb 11, 2021): I'm gonna leave this open then and re-purpose this as "we need a more expressive message in this case".
Author
Owner

@DHowett commented on GitHub (Feb 11, 2021):

As an aside,

"startingDirectory": "~/",

I'm surprised that this doesn't on its own cause trouble.

(Also, doesn't the powershell generator detect this specific instance of powershell preview?)

@DHowett commented on GitHub (Feb 11, 2021): As an aside, > "startingDirectory": "~/", I'm surprised that this doesn't _on its own_ cause trouble. (Also, doesn't the powershell generator detect this specific instance of powershell preview?)
Author
Owner

@erichiller commented on GitHub (Feb 13, 2021):

Here's my output for gc function:/Prompt:

$lastCommandFailed = ($global:error.Count -gt $sl.ErrorCount) -or -not $?
$sl.ErrorCount = $global:error.Count                                                                                                                                                                                                                                                                                                                #Start the vanilla posh-git when in a vanilla window, else: go nuts
if(Test-IsVanillaWindow) {
    Write-Host -Object ($pwd.ProviderPath) -NoNewline
    Write-VcsStatus
}

Reset-CursorPosition
$prompt = (Write-Theme -lastCommandFailed $lastCommandFailed)

if($sl.Options.ConsoleTitle) {
    $location = Get-Location
    $folder = (Get-ChildItem | Select-Object -First 1).Parent.BaseName
    $prompt += "$([char]27)]2;$($folder)$([char]7)"
    if ($location.Provider.Name -eq "FileSystem") {
        $prompt += "$([char]27)]9;9;`"$($location.Path)`"$([char]7)"
    }
}

$prompt

Also, I will note that I've just updated to 1.6.10412.0 and the issue has been fixed. But I agree that a more expressive error message would be nice. Thanks for the fix!

@erichiller commented on GitHub (Feb 13, 2021): Here's my output for `gc function:/Prompt`: ``` $lastCommandFailed = ($global:error.Count -gt $sl.ErrorCount) -or -not $? $sl.ErrorCount = $global:error.Count #Start the vanilla posh-git when in a vanilla window, else: go nuts if(Test-IsVanillaWindow) { Write-Host -Object ($pwd.ProviderPath) -NoNewline Write-VcsStatus } Reset-CursorPosition $prompt = (Write-Theme -lastCommandFailed $lastCommandFailed) if($sl.Options.ConsoleTitle) { $location = Get-Location $folder = (Get-ChildItem | Select-Object -First 1).Parent.BaseName $prompt += "$([char]27)]2;$($folder)$([char]7)" if ($location.Provider.Name -eq "FileSystem") { $prompt += "$([char]27)]9;9;`"$($location.Path)`"$([char]7)" } } $prompt ``` Also, I will note that I've just **updated to 1.6.10412.0 and the issue has been fixed**. But I agree that a more expressive error message would be nice. Thanks for the fix!
Author
Owner

@ghost commented on GitHub (May 25, 2021):

:tada:This issue was addressed in #10045, which has now been successfully released as Windows Terminal v1.8.1444.0.🎉

Handy links:

@ghost commented on GitHub (May 25, 2021): :tada:This issue was addressed in #10045, which has now been successfully released as `Windows Terminal v1.8.1444.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.8.1444.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (May 25, 2021):

:tada:This issue was addressed in #10045, which has now been successfully released as Windows Terminal Preview v1.9.1445.0.🎉

Handy links:

@ghost commented on GitHub (May 25, 2021): :tada:This issue was addressed in #10045, which has now been successfully released as `Windows Terminal Preview v1.9.1445.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.9.1445.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12509