# terminal: Fix COLORTERM regression for true color support \(\#38379\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/4b1e78cd5c4ed69a168409620a272fc63fa2f433)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 4b1e78cd5c4ed69a168409620a272fc63fa2f433

Requested commit: 4b1e78cd5c4ed69a168409620a272fc63fa2f433

Commit: 4b1e78cd5c4ed69a168409620a272fc63fa2f433

Tree: 2232786e0234b22ee7267781c7d59697ed99097d

Author: Miao

Committer: GitHub

## Message

````
terminal: Fix COLORTERM regression for true color support (#38379)

Closes #38304 

Release Notes:

- Fixed true color detection regression by setting `COLORTERM=truecolor`

---

Reason:

The regression is possibly introduced in [pr#36576: Inject venv
environment via the
toolchain](https://github.com/zed-industries/zed/pull/36576/files#diff-6f30387876b79f1de44f8193401d6c8fb49a2156479c4f2e32bc922ec5d54d76),
where `alacritty_terminal::tty::setup_env();` is removed.

The `alacritty_terminal::tty::setup_env();` does 2 things, which sets
`TERM` & `COLORTERM` envvar.
```rs
/// Setup environment variables.
pub fn setup_env() {
    // Default to 'alacritty' terminfo if it is available, otherwise
    // default to 'xterm-256color'. May be overridden by user's config
    // below.
    let terminfo = if terminfo_exists("alacritty") { "alacritty" } else { "xterm-256color" };
    unsafe { env::set_var("TERM", terminfo) };

    // Advertise 24-bit color support.
    unsafe { env::set_var("COLORTERM", "truecolor") };
}
```
````

## Parents

- [eaa1cb0ca32d978f2424c417fb10f4e622fb40cb](https://git.cafe/gitcafe/zed/commit/eaa1cb0ca32d978f2424c417fb10f4e622fb40cb?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/4b1e78cd5c4ed69a168409620a272fc63fa2f433?format=markdown)
