I reproduced this on macOS and have a small fix ready for TERM_PROGRAM and TERM_PROGRAM_VERSION.
The patch sets them to t3code and the server package version when T3 Code creates the terminal environment. It overrides inherited values such as Apple_Terminal, while explicit per-terminal runtime overrides still take precedence.
I tested:
- Both variables missing from the parent environment
- Inherited
Apple_Terminaland version2.14 - Explicit runtime overrides
- The complete terminal manager test file, with all 56 tests passing
I am leaving COLORTERM out because #7680 already covers it. I will open a focused PR for the first two variables and link it here.