PowerShell / PowerShell/vscode-powershell

Window focus during debug in VSCode

Open
#1,175 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Extension Terminal Issue-Bug
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

•VSCode Version: Code 1.19.3 (7c4205b, 2018-01-25T10:36:34.867Z)
•OS Version: Windows_NT x64 10.0.16299
•Extensions:
Author (truncated)
Version
PowerShell ms- 1.5.1
team ms- 1.122.0

Issue Description

I use the code snippet below a lot to display a windows explorer window for the selection of a input file by a end user. When debugging in VSCode the dialog box that is called is not brought to the foreground. In order to see the dialog, you need to minimize VSCode answer the dialog which returns focus back to VSCode.

Function Get-FileName($StartDirectory){
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$openFileDialog.initialDirectory = $StartDirectory
$openFileDialog.filter = "All files (.)| ."
$openFileDialog.ShowDialog() | Out-Null
$openFileDialog.filename
}

Attached Logs

PSR of issue.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the PowerShell Windows Forms OpenFileDialog example while debugging in VS Code on Windows, then review the attached PSR logs for focus-related evidence. Done means the dialog reliably appears in the foreground during a debug session without requiring VS Code to be minimized.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.