# process.inherit_stdio ## 功能 让子进程继承当前进程 stdio。 ## 语法 ```bt process(program).inherit_stdio() ``` ## 参数 无参数。 ## 返回值 | 类型 | 说明 | | ------ | ------ | | Process | 返回新的进程构建器。 | ## 示例 ```bt cmd = process('cmd').inherit_stdio() result = type(cmd) // 输出:Process print result ``` ## 注意事项 - 会覆盖 null_stdio 设置。 - 会关闭默认 window_hidden 行为,让子进程继承当前进程 stdio,适合 CLI 中需要用户直接交互的程序。 - 桌面 App 中需要后台运行并读取 stdout/stderr 时不要调用 inherit_stdio(),保持默认行为或显式调用 window_hidden()。