# Std.process.run and ANSI escape codes

**URL:** <https://ziggit.dev/t/std-process-run-and-ansi-escape-codes/18561>\
**Category:** Help\
**Tags:** standard-library\
**Created:** [November 23, 2026, 2:49pm UTC](https://ziggit.dev/t/std-process-run-and-ansi-escape-codes/18561 "2026-11-23T14:49:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeakyBucket](https://ziggit.dev/letter_avatar_proxy/v4/letter/l/3ec8ea/32.png) [@LeakyBucket](https://ziggit.dev/u/LeakyBucket)\
**Post date:** [November 23, 2026, 2:49pm UTC](https://ziggit.dev/t/std-process-run-and-ansi-escape-codes/18561/1 "2026-11-23T14:49:48Z")

</div>

Hello,

I’m working on a dumb personal thing (a shell) and currently I’m launching external commands using `std.process.run`. However when I get `stdout` from the result and write it to the parent’s `stdout` it would appear that the ANSI escape codes are missing. This may be something completely unrelated to how the standard library is handling things and is being caused by something else I am equally ignorant about. I was hoping though that someone could maybe point me in the right direction. I did a bit of digging in the docs and didn’t see anything there. When I check `stdout` for the parent process (shell) ANSI escape codes are enabled, and also printf works fine so I suspect it has something to do with what the child process sees in it’s env maybe or something in the “handoff” of the stdout data.

---

<div class="post-metadata">

**Author:** ![Southporter](https://ziggit.dev/user_avatar/ziggit.dev/southporter/32/2500_2.png) [@Southporter](https://ziggit.dev/u/Southporter)\
**Post date:** [November 23, 2026, 3:10pm UTC](https://ziggit.dev/t/std-process-run-and-ansi-escape-codes/18561/2 "2026-11-23T15:10:54Z")

</div>

How are you setting stdout on the child?  
One thing you may be running into is that if you set it as a pipe, you may be confusing the child process. The child process can check if the stdin/stdout file descriptors are ttys. If not, they may decide to not use escape codes because they are acting as if they are being piped somewhere else.

---

<div class="post-metadata">

**Author:** ![LeakyBucket](https://ziggit.dev/letter_avatar_proxy/v4/letter/l/3ec8ea/32.png) [@LeakyBucket](https://ziggit.dev/u/LeakyBucket)\
**Post date:** [November 23, 2026, 8:03pm UTC](https://ziggit.dev/t/std-process-run-and-ansi-escape-codes/18561/3 "2026-11-23T20:03:24Z")

</div>

Ah! Thanks, that led me down the right path. `std.process.RunOptions` has nothing for `std*`, it would appear based on your help that it does not `inerit` which makes sense when I think about it more. Using `std.process.spawn` then calling `wait` on the child did the trick. `std.process.SpawnOptions` lets you specify each of the `stdIo` values (with a default of `inherit` for each).

Thanks again!
