mirror of
https://github.com/openai/codex.git
synced 2026-05-15 16:53:05 +00:00
## Summary Removes high-confidence unused Rust helper functions and exports across `codex-tui`, `codex-shell-command`, and utility crates. The cleanup includes dead TUI helper methods, unused path/string/elapsed/fuzzy-match utilities, an unused Windows PowerShell lookup helper, and the unused terminal palette version counter. This keeps the remaining public surface smaller without changing behavior. ## Validation - `just fmt` - `cargo test -p codex-tui -p codex-shell-command -p codex-utils-elapsed -p codex-utils-fuzzy-match -p codex-utils-string -p codex-utils-path` - `just fix -p codex-tui -p codex-shell-command -p codex-utils-elapsed -p codex-utils-fuzzy-match -p codex-utils-string -p codex-utils-path` - `git diff --check`
20 lines
563 B
Rust
20 lines
563 B
Rust
//! Functions for environment detection that need to be shared across crates.
|
|
|
|
/// Returns true if the current process is running under Windows Subsystem for Linux.
|
|
pub fn is_wsl() -> bool {
|
|
#[cfg(target_os = "linux")]
|
|
{
|
|
if std::env::var_os("WSL_DISTRO_NAME").is_some() {
|
|
return true;
|
|
}
|
|
match std::fs::read_to_string("/proc/version") {
|
|
Ok(version) => version.to_lowercase().contains("microsoft"),
|
|
Err(_) => false,
|
|
}
|
|
}
|
|
#[cfg(not(target_os = "linux"))]
|
|
{
|
|
false
|
|
}
|
|
}
|