rustimal 0.2.4

A minimal, GPU-rendered terminal for Windows that runs Git Bash, with animated split panes and a glass look
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

mod anim;
mod app;
mod boxdraw;
mod claude;
mod cli;
mod config;
mod glass;
mod glyphs;
mod gpu;
mod icon;
mod input;
mod layout;
mod pane;
mod picker;
mod render;
mod winenv;

use std::path::PathBuf;

use winit::event_loop::EventLoop;

use crate::app::App;
use crate::pane::UserEvent;

/// Session markers a parent Claude Code process leaves in the environment.
/// Inherited by shells, they make Claude think it is a child session
/// (e.g. it stops saving transcripts), so strip them.
const CLAUDE_SESSION_VARS: &[&str] = &[
    "CLAUDECODE",
    "CLAUDE_PID",
    "CLAUDE_EFFORT",
    "CLAUDE_AGENT_SDK_VERSION",
    "CLAUDE_CODE_CHILD_SESSION",
    "CLAUDE_CODE_SESSION_ID",
    "CLAUDE_CODE_SESSION_ATTENDED",
    "CLAUDE_CODE_ENTRYPOINT",
    "CLAUDE_CODE_EXECPATH",
    "CLAUDE_CODE_MESSAGING_SOCKET",
    "CLAUDE_CODE_MESSAGING_TOKEN",
    "CLAUDE_CODE_SSE_PORT",
];

fn main() {
    for var in CLAUDE_SESSION_VARS {
        // SAFETY: called before any other threads are spawned.
        unsafe { std::env::remove_var(var) };
    }
    env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();

    // Optional first argument: starting directory, or a command like --install.
    let first = std::env::args().nth(1);
    if let Some(code) = first.as_deref().and_then(cli::run) {
        std::process::exit(code);
    }
    // Explorer passes drive roots as "C:\", which Windows' argument parsing turns into `C:"`.
    let start_dir = first
        .map(|a| {
            let a = a.trim_end_matches('"').to_string();
            PathBuf::from(if a.ends_with(':') { a + "\\" } else { a })
        })
        .filter(|p| p.is_dir())
        .or_else(dirs::home_dir);

    let event_loop = EventLoop::<UserEvent>::with_user_event().build().expect("event loop");
    let mut app = App::new(event_loop.create_proxy(), config::Config::load(), start_dir);
    event_loop.run_app(&mut app).expect("event loop failed");
}