Regarding the termination of processes, the code uses the Kill function. However, it does not provide termination detection. Thank you for the suggestion, it might be a good idea to add this feature. Due to the differences in system APIs between Windows and UNIX, SIGTERM is chosen instead of SIGKILL to ensure compatibility with both platforms.
The issue with the new process not producing any output is mainly due to the differences in the implementation of Melang script on Windows and UNIX. Specifically, the system APIs for launching new processes and redirecting input/output differ significantly between Windows and UNIX, making it challenging to achieve perfect compatibility with Windows at the moment. Currently, the exec function in Melang can retrieve program output on UNIX systems, but it is not used to maintain consistency across both platforms. This is indeed one of the areas that needs improvement in the future.
Thank you for your analysis of the project and providing valuable insights.