Don't try to connect to X11/Wayland when headless (#15028)

Release Notes:

- remote development: Stopped logging every 16ms when connected to a
remote server with a badly configured X server.
This commit is contained in:
Conrad Irwin 2024-07-23 14:11:47 -06:00 committed by GitHub
parent 5021397c01
commit 41a3e78b1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -87,6 +87,9 @@ pub(crate) fn current_platform(headless: bool) -> Rc<dyn Platform> {
#[cfg(target_os = "linux")]
#[inline]
pub fn guess_compositor() -> &'static str {
if std::env::var_os("ZED_HEADLESS").is_some() {
return "Headless";
}
let wayland_display = std::env::var_os("WAYLAND_DISPLAY");
let x11_display = std::env::var_os("DISPLAY");