Some commands (GIT , AZ) hang when using the dotnet interactive kernel in VS Code but are OK with the .net(powershell) on in VSCode or Jupyter.
See original GitHub issueThis may need to be logged as a VSCode problem, but because the behaviour seems to be different between two dotnet interactive kernels I’m starting here
Describe the bug
An advantage of having PowerShell as a supported environment in notebooks the ability to run any command line and capture its output. For example a powershell cell can contain
ping localhost
I have been been using this to create a shared notebook of useful git examples. With combination of anaconda / Jupyter and the .NET (PowerShell) kernel,
git status
and similar work. Doing the same in VSCode fails with the default kernel. The command will hang indefinitely, and usually clicking the stop button returns
Error: System.OperationCanceledException: Command :SubmitCode: git status cancelled.
but I have seen this return the output (rarely).
But I can switch kernels and get it to work. (See screen shots.) I’d like to use the notebooks on machines without the python / jupyter bits (only with VSCode) so this is only a partial solution.
It does not affect all commands “Net share” , “ping”, “Ipconfig” “nslookup google.com”, “Tasklist” all work, so Initially I thought this was something specific to git.exe but “az -h” has the same problem
I’ve also tried running the command as a job with Start-Job {git status} | wait-job | receive-job
but this gives the error
Start-Job: The pwsh executable cannot be found at "C:\Users\P10506111\.nuget\packages\microsoft.dotnet-interactive\1.0.240403\tools\net5.0\any\runtimes\win\lib\net5.0\pwsh.exe".
Note that 'Start-Job' is not supported by design in scenarios where PowerShell is being hosted in other applications.
And by trying to remote to a PSSession on my machine with
$pss = New-PSSession -ComputerName localhost -EnableNetworkAccess
gives
New-PSSession: [localhost] An error has occurred which PowerShell cannot handle. A remote session might have ended.
From the message the first looks to be by design, I can’t tell if the second is design, bug or user error - they fail in both kernels. I have also tried creating a PS Runspace to run the command in the default kernel - no joy with that either.
Please complete the following:
Which version of .NET Interactive are you using? There are a few ways to find this out: Version: 1.0.240403+56a0e392fba305af06e72ce7dec885b2b6722c00 Build date: 2021-08-09T11:46:14.5291024Z
- OS
- Windows 10
- Browser
- Edge
- Frontend
- Jupyter Notebook
- Visual Studio Code
- Visual Studio Code Insiders
##Screenshots
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
This looks to me like a VS Code messaging issue. The command appears to complete once you trigger another command, e.g. running another cell or even hovering somewhere that triggers a hover text request:
@brettfo
@jonsequitur No, not sure what is going on. I tried with Jupyter notebook + latest stable version of
Microsoft.dotnet-interactive
global tool, andgit status
does work in it. What are the differences between dotnet-interactive running in VSCode and in Jupyter notebook?@dfinke How did you install .NET Interactive Notebook in GitHub codespace? It says “not available in VS Code Web” for me: