vors / jupyter-powershell

PowerShell language kernel for Jupyter
MIT License
132 stars 26 forks source link

Start powershell in noninteractive mode since stdin isn't currently supported. #26

Closed corivera closed 4 years ago

corivera commented 4 years ago

Fixes https://github.com/vors/jupyter-powershell/issues/23

This is just a quick fix for the above. The actual fix would likely involve overriding Read-Host with a custom function. The IPyKernel overwrites raw_input() with its own version to handle prompting for input, so maybe we can call raw_input() via python from a custom Read-Host. If that doesn't work, then we'd need to find a way to integrate the custom Read-Host will all the jupyter socket/messaging logic.

I've also verified that we see an error in the cell output when trying to run functions like Read-Host with this change.

vors commented 4 years ago

How old is this flag? Is it something new in pwsh 6/7 or it existed in windows powershell?

corivera commented 4 years ago

It's listed in these docs for powershell 3.0, so I imagine it's been around for a while.

https://docs.microsoft.com/en-us/previous-versions/powershell/module/microsoft.powershell.core/about/about_powershell_exe?view=powershell-3.0#-noninteractive