terminal: Bump sysinfo crate (#39681)

Release Notes:

- N/A *or* Added/Fixed/Improved ...

Co-authored-by: dino <dinojoaocosta@gmail.com>
This commit is contained in:
Lukas Wirth
2025-10-13 16:31:00 +00:00
committed by GitHub
co-authored by dino
parent bec2bfeb8b
commit f76eecd758
9 changed files with 57 additions and 75 deletions
+3 -3
View File
@@ -331,7 +331,7 @@ impl RemoteClient {
let ssh_connection = cx
.update(|cx| {
cx.update_default_global(|pool: &mut ConnectionPool, cx| {
pool.connect(connection_options.clone(), &delegate, cx)
pool.connect(connection_options.clone(), delegate.clone(), cx)
})
})?
.await
@@ -561,7 +561,7 @@ impl RemoteClient {
let (ssh_connection, io_task) = match async {
let ssh_connection = cx
.update_global(|pool: &mut ConnectionPool, cx| {
pool.connect(connection_options, &delegate, cx)
pool.connect(connection_options, delegate.clone(), cx)
})?
.await
.map_err(|error| error.cloned())?;
@@ -987,7 +987,7 @@ impl ConnectionPool {
pub fn connect(
&mut self,
opts: RemoteConnectionOptions,
delegate: &Arc<dyn RemoteClientDelegate>,
delegate: Arc<dyn RemoteClientDelegate>,
cx: &mut App,
) -> Shared<Task<Result<Arc<dyn RemoteConnection>, Arc<anyhow::Error>>>> {
let connection = self.connections.get(&opts);
+2 -2
View File
@@ -270,8 +270,6 @@ impl SshRemoteConnection {
) -> Result<Self> {
use askpass::AskPassResult;
delegate.set_status(Some("Connecting"), cx);
let url = connection_options.ssh_url();
let temp_dir = tempfile::Builder::new()
@@ -285,6 +283,8 @@ impl SshRemoteConnection {
let mut askpass =
askpass::AskPassSession::new(cx.background_executor(), askpass_delegate).await?;
delegate.set_status(Some("Connecting"), cx);
// Start the master SSH process, which does not do anything except for establish
// the connection and keep it open, allowing other ssh commands to reuse it
// via a control socket.
+3 -4
View File
@@ -988,10 +988,9 @@ fn is_new_version(version: &str) -> bool {
}
fn is_file_in_use(file_name: &OsStr) -> bool {
let info =
sysinfo::System::new_with_specifics(sysinfo::RefreshKind::new().with_processes(
sysinfo::ProcessRefreshKind::new().with_exe(sysinfo::UpdateKind::Always),
));
let info = sysinfo::System::new_with_specifics(sysinfo::RefreshKind::nothing().with_processes(
sysinfo::ProcessRefreshKind::nothing().with_exe(sysinfo::UpdateKind::Always),
));
for process in info.processes().values() {
if process
+2 -2
View File
@@ -36,7 +36,7 @@ impl SystemSpecs {
let release_channel = ReleaseChannel::global(cx);
let os_name = telemetry::os_name();
let system = System::new_with_specifics(
RefreshKind::new().with_memory(MemoryRefreshKind::everything()),
RefreshKind::nothing().with_memory(MemoryRefreshKind::everything()),
);
let memory = system.total_memory();
let architecture = env::consts::ARCH;
@@ -79,7 +79,7 @@ impl SystemSpecs {
let os_name = telemetry::os_name();
let os_version = telemetry::os_version();
let system = System::new_with_specifics(
RefreshKind::new().with_memory(MemoryRefreshKind::everything()),
RefreshKind::nothing().with_memory(MemoryRefreshKind::everything()),
);
let memory = system.total_memory();
let architecture = env::consts::ARCH;
+3 -2
View File
@@ -89,11 +89,11 @@ pub struct PtyProcessInfo {
impl PtyProcessInfo {
pub fn new(pty: &Pty) -> PtyProcessInfo {
let process_refresh_kind = ProcessRefreshKind::new()
let process_refresh_kind = ProcessRefreshKind::nothing()
.with_cmd(UpdateKind::Always)
.with_cwd(UpdateKind::Always)
.with_exe(UpdateKind::Always);
let refresh_kind = RefreshKind::new().with_processes(process_refresh_kind);
let refresh_kind = RefreshKind::nothing().with_processes(process_refresh_kind);
let system = System::new_with_specifics(refresh_kind);
PtyProcessInfo {
@@ -112,6 +112,7 @@ impl PtyProcessInfo {
let pid = self.pid_getter.pid()?;
if self.system.refresh_processes_specifics(
sysinfo::ProcessesToUpdate::Some(&[pid]),
true,
self.refresh_kind,
) == 1
{
+3 -4
View File
@@ -466,16 +466,15 @@ impl TerminalBuilder {
let shell_params = match shell.clone() {
Shell::System => {
#[cfg(target_os = "windows")]
{
if cfg!(windows) {
Some(ShellParams::new(
util::shell::get_windows_system_shell(),
None,
None,
))
} else {
None
}
#[cfg(not(target_os = "windows"))]
None
}
Shell::Program(program) => Some(ShellParams::new(program, None, None)),
Shell::WithArguments {