Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when piping INTO wsl.exe the program running inside WSL through wsl.exe is not interactive, and the shell appears to hang/freeze #11465

Open
1 of 2 tasks
wis opened this issue Apr 15, 2024 · 3 comments
Labels
emailed-logs Logs have been emailed

Comments

@wis
Copy link

wis commented Apr 15, 2024

Windows Version

Microsoft Windows [Version 10.0.22621.3374]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.146.1-2

Distro Version

Arch (https://github.com/yuk7/ArchWSL)

Other Software

When piping data to wsl.exe it should pipe/pass it through to the Linux program running inside WSL, e.g:

If inside PowerShell:

Get-Content some-file.txt |  wsl.exe -e nvim

I should be able to edit the contents of some-file.txt inside Neovim running inside WSL, but Neovim is not interactive, like as if the shell hangs/freezes.

or if inside cmd.exe:

echo ABCDEFGHIJKL | wsl.exe -e nvim

Same thing happens when piping the contents of some-file.txt to less running inside WSL, opened from cmd.exe, same result, less is not interactive, and the shell appears to hang/freeze:

type some-file.txt | wsl.exe -- less

Repro Steps

  1. Open any shell you'd like, for this repro steps i'm going with PowerShell, but the shell does not matter.
  2. Pipe the contents of some-file.txt into Neovim running inside WSL through wsl.exe
    • If you don't have a some-file.txt file, create it with echo some-text-contents > some-file.txt
    • to do that, you can run: Get-Content my-file.txt | wsl.exe -e nvim
  3. Try pressing any key to check if the text editor is interactive and if the shell did not hang/freeze

Expected Behavior

Neovim running inside WSL should be interactive when I press keys, the shell should not freeze

Actual Behavior

Neovim (or any interactive CLI/TUI program, e.g. less, it's not about Neovim) is not interactive, it is as if the shell hangs/freezes (not the Terminal emulator, just the shell inside it), When I press any key, nothing happens,
When I press Ctrl-C, the program appears to exit and I return to the shell prompt (it unhangs/unfreezes when it returns to the Console/shell running in Windows).

Diagnostic Logs

Please provide additional diagnostics if needed.

It is not needed. especially since this is an issue with the wsl.exe utility program, not WSL itself.

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

@wis
Copy link
Author

wis commented Apr 15, 2024

/emailed-logs

Copy link

Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'

@github-actions github-actions bot added the emailed-logs Logs have been emailed label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emailed-logs Logs have been emailed
Projects
None yet
Development

No branches or pull requests

1 participant