Don't upload panic files when running in a PTY
This commit is contained in:
parent
24ba47e75d
commit
eb6088701e
1 changed files with 10 additions and 9 deletions
|
@ -119,7 +119,9 @@ fn main() {
|
||||||
));
|
));
|
||||||
|
|
||||||
watch_settings_file(default_settings, settings_file_content, themes.clone(), cx);
|
watch_settings_file(default_settings, settings_file_content, themes.clone(), cx);
|
||||||
|
if !stdout_is_a_pty() {
|
||||||
upload_previous_panics(http.clone(), cx);
|
upload_previous_panics(http.clone(), cx);
|
||||||
|
}
|
||||||
|
|
||||||
let client = client::Client::new(http.clone(), cx);
|
let client = client::Client::new(http.clone(), cx);
|
||||||
let mut languages = LanguageRegistry::new(login_shell_env_loaded);
|
let mut languages = LanguageRegistry::new(login_shell_env_loaded);
|
||||||
|
@ -330,6 +332,10 @@ fn init_panic_hook(app_version: String) {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if is_pty {
|
||||||
|
eprintln!("{}", message);
|
||||||
|
} else {
|
||||||
|
log::error!(target: "panic", "{}", message);
|
||||||
let panic_filename = chrono::Utc::now().format("%Y_%m_%d %H_%M_%S").to_string();
|
let panic_filename = chrono::Utc::now().format("%Y_%m_%d %H_%M_%S").to_string();
|
||||||
std::fs::write(
|
std::fs::write(
|
||||||
paths::LOGS_DIR.join(format!("zed-{}-{}.panic", app_version, panic_filename)),
|
paths::LOGS_DIR.join(format!("zed-{}-{}.panic", app_version, panic_filename)),
|
||||||
|
@ -337,11 +343,6 @@ fn init_panic_hook(app_version: String) {
|
||||||
)
|
)
|
||||||
.context("error writing panic to disk")
|
.context("error writing panic to disk")
|
||||||
.log_err();
|
.log_err();
|
||||||
|
|
||||||
if is_pty {
|
|
||||||
eprintln!("{}", message);
|
|
||||||
} else {
|
|
||||||
log::error!(target: "panic", "{}", message);
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue