Initial public release of Warp.

Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
David Stern
2026-04-28 08:43:33 -05:00
commit 0dbd3d567a
4982 changed files with 1431549 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
use crate::crash_reporting::VirtualEnvironment;
/// Returns what virtualized environment Warp is running in, if any.
pub fn get_virtualized_environment() -> Option<VirtualEnvironment> {
if let Ok(output) = command::blocking::Command::new("systemd-detect-virt").output() {
if !output.status.success() {
return None;
} else {
let value = std::str::from_utf8(&output.stdout).ok()?;
if value == "none" {
return None;
}
return Some(VirtualEnvironment {
name: value.to_owned(),
});
}
};
// Test specifically for WSL based on existence of a particular file under
// /proc.
//
// See: https://superuser.com/questions/1749781/how-can-i-check-if-the-environment-is-wsl-from-a-shell-script
if std::path::Path::new("/proc/sys/fs/binfmt_misc/WSLInterop").exists() {
return Some(VirtualEnvironment {
name: "wsl".to_owned(),
});
}
None
}