Repository: node
Issue: `child_process.spawn` with inherited stdout breaks logging colors on Windows even after childprocess exits
Labels: child_process,windows

### Version

v18.8.0

### Platform

Microsoft Windows NT 10.0.19044.0 x64

### Subsystem

Multiple (child_process, console, process, tty, fs)

### What steps will reproduce the bug?

The following code attempts every possible logging method after spawning a basic child_process:
```js
import chp from 'child_process';
import tty from 'tty';
import fs from 'fs';

const RED = '\x1B[31m'; RED;
const RESET = '\x1B[0m'; RESET;

const child = chp.spawn("echo", ["foo"], {
    stdio: [null, "inherit", "inherit"]
});
console.log(111);
child.on('exit', (code, signal) => {
    console.log(222);
    // try to terminate any lingering stuff that could still be running and interfering (spoiler: doesn't work)
    child.kill();
    child.disconnect?.();
    child.removeAllListeners();
    child.channel?.close();
    child.channel?.unref();
    child.unref();
    child.stdin?.destroy();
    child.stdout?.destroy();
    child.stderr?.destroy();
    console.log(333);
    console.dir(444);
    console.error(555);
    console.warn(666);
    console.info(777);
    console.debug(888);
    process.stdout.write(RED + "process" + RESET);
    new tty.WriteStream(1).write(RED + "tty" + RESET);
    fs.writeSync(1, RED + "fs" + RESET);
});
console.log(-1);
```

### How often does it reproduce? Is there a required condition?

- Only happens on native Windows (Works fine on WSL2)
- Is not a cmd.exe or "terminal doesn't support colors" issue because:
  - I'm not using cmd.exe (PowerShell 7.x on Windows Terminal)
  - Colors work fine until the child process is ran
- Only happens when `stdio` is `[any, <InheritLike>, any]`
  - Where `<InheritLike>` is one of: `"inherit"`, `process.stdout`, `process.stdout.fd`, `1`
- Does not happen when piping manually with `stdio: [any, "pipe", any]` and then `child.stdout.pipe(process.stdout)`
- Passing either `FORCE_COLOR` or `NO_COLOR` environment variables doesn't do anything.
- Happens with any command, not only `echo`, I've also tried `cat` and `ls`.
- Also happens with `spawnSync`, not only `spawn`.
- Doesn't happen with `exec` or `execSync` variants.

### What is the expected behavior?

The expected output would be: (ordering of where the `foo` line appears may differ and doesn't matter)
```
111
-1
foo
222
333
444
555
666
777
888
processttyfs
```
At bare minimum, colorless but without any broken color codes visible, and at best, with the actual colors rendered properly like below:
![image](https://user-images.githubusercontent.com/32803471/195954619-36fb8077-4858-44aa-a6a4-344eeb4cc869.png)


### What do you see instead?

The code provided above results in the following output:
```
111
-1
foo
←[33m222←[39m
←[33m333←[39m
←[33m444←[39m
←[33m555←[39m
←[33m666←[39m
←[33m777←[39m
←[33m888←[39m
←[31mprocess←[0m←[31mtty←[0m←[31mfs←[0m
```
As screenshot for color rendering viewing:
![image](https://user-images.githubusercontent.com/32803471/195954291-8f7b2b34-05e2-4fc1-8ed7-9d615683b64b.png)



### Additional information

The issue seems related to the fact that [`\u2190`](https://www.fileformat.info/info/unicode/char/2190/index.htm) (`←`) is being printed instead of [`\x1B`](https://www.fileformat.info/info/unicode/char/001B/index.htm) for the first character of the ANSI codes, which logically makes it unrecognizable as a color code to the terminal.