From 51818a34f5c872af8b4ee083170037203f81ae23 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 21 Dec 2023 10:11:11 -0700 Subject: [PATCH] Set up environmental variables for terminal --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ffda820..aa0bad3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,9 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use alacritty_terminal::{event::Event as TermEvent, term::color::Colors as TermColors}; +use alacritty_terminal::{ + config::Config as TermConfig, event::Event as TermEvent, term::color::Colors as TermColors, tty, +}; use cosmic::{ app::{Command, Core, Settings}, cosmic_theme, executor, @@ -32,6 +34,13 @@ mod terminal_theme; fn main() -> Result<(), Box> { env_logger::init(); + // Set up environmental variables for terminal + { + let mut term_config = TermConfig::default(); + // Override TERM for better compatibility + term_config.env.insert("TERM".to_string(), "xterm-256color".to_string()); + tty::setup_env(&term_config); + } let settings = Settings::default() .antialiasing(true)