-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Windows Version
10.0.22621.5472
WSL Version
2.5.9.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
6.6.87.2
Distro Version
Ubuntu 24.04
Other Software
Nothing of relevance.
Repro Steps
Within the distribution in a Bash or Zsh shell, execute the following:
sudo setsid --fork --wait "/mnt/c/Program Files/PowerShell/7/pwsh.exe" -NoLogo -NonInteractive -Command "Get-Date" 2>&1Expected Behavior
Output just includes the date.
The relevant code is:
Lines 683 to 693 in 902848b
| auto processGroup = tcgetpgrp(0); | |
| if (processGroup < 0) | |
| { | |
| LOG_STDERR("tcgetpgrp failed"); | |
| return; | |
| } | |
| if (processGroup != getpgrp()) | |
| { | |
| return; | |
| } |
I wonder why in the case of tcgetpgrp the error is logged but if getpgrp has a problem no error is logged. Maybe the log statement was once added for debugging purposes?
I came across this when setting up a scheduled monitoring task in WSL using Monit that triggers Powershell to send a notification to the desktop. It does so without a TTY.
Actual Behavior
Output includes error from binfmt and date.
tcgetpgrp failed: Not a tty
Montag, 23. Juni 2025 12:00:47
Diagnostic Logs
Metadata
Metadata
Assignees
Labels
No labels