-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Process.run() fails to execute command completely #4803
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
Comments
Yeah, on Linux, Foundation.Process detects if the child process is running incorrectly. I can't promise but I think it's entirely possible that this bug here is caused by the same underlying issue that causes #4795 |
@weissi Thank you very much for your response. I encountered an issue while using macOS, but I believe #4795 is of reference value to this issue, and I am still exploring it. Additionally, I think this issue may have been raised in the wrong repo, but since I do not have master permissions, I am unable to transfer the issue. Would you be able to help me transfer the issue to https://github.com/apple/swift-foundation? Thank you very much! |
@CrazyFanFan Did you use |
Yes, I'm using |
Description
When using the Process.run() method to execute a command, the command fails to execute completely and the program terminates prematurely. The issue is observed when executing the following Swift code:
The expected behavior is that the ls command should be executed successfully and the program should print "enter", the termination status of the process, and "leave" in the console.
Steps to reproduce
swift main.swift
Expected behavior
The ls command should be executed successfully and the program should print "enter", the termination status of the process, and "leave" in the console.
Note:
The issue appears to be related to the use of the /usr/bin/script command with the -aq options. Removing these options or using a different command appears to resolve the issue.
Environment
The text was updated successfully, but these errors were encountered: