# process.child ## Function Starts the child process and saves the handle in the current Process object. ## Syntax ```bt process(program).child() ``` ## Parameters No parameters. ## Return value | Type | Description | | ------ | ------ | | Process | Returns a Process object that shares the same child process handle. | ## Example ```bt child = process('cmd').args(['/C', 'exit 0']).child() result = type(child) // Output: Process print result ``` ## Notes - Cloned objects of the same Process share child process handles. - The stdout/stderr pipe is started by default, and can be read later through stdout_read, stdout_read_lines, stderr_read, and stderr_read_lines. - When stdin(text) is not called, child() will close the child process stdin and will not inherit the parent process stdin, preventing desktop apps or background services from inheriting invalid input handles. - The console child process window is hidden by default under Windows, and a black console window will not pop up when starting the console program in the desktop app. - The child process does not retain script-side readable pipes if inherit_stdio() or null_stdio() is called early. - If stdin(text) is called in advance, child() will write the text and close the stdin pipe to avoid the child process waiting for input for a long time. - When the Process object is finally released, it will terminate the managed subprocess that is still running; under Windows, it will try to terminate the subprocess tree recursively.