From 29ec464767edbc732e5f40fd525455b6b607d0ac Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 2 Dec 2023 16:26:52 +0100 Subject: [PATCH] Remove obsolete cur_term() wrapper --- fish-rust/src/compat.c | 2 -- fish-rust/src/compat.rs | 5 ----- fish-rust/src/proc.rs | 4 ++-- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/fish-rust/src/compat.c b/fish-rust/src/compat.c index c0c21e158..581c25c1a 100644 --- a/fish-rust/src/compat.c +++ b/fish-rust/src/compat.c @@ -12,8 +12,6 @@ size_t C_MB_CUR_MAX() { return MB_CUR_MAX; } -int has_cur_term() { return cur_term != NULL; } - uint64_t C_ST_LOCAL() { #if defined(ST_LOCAL) return ST_LOCAL; diff --git a/fish-rust/src/compat.rs b/fish-rust/src/compat.rs index 1a0de1e76..117539d0a 100644 --- a/fish-rust/src/compat.rs +++ b/fish-rust/src/compat.rs @@ -8,10 +8,6 @@ pub fn MB_CUR_MAX() -> usize { unsafe { C_MB_CUR_MAX() } } -pub fn cur_term() -> bool { - unsafe { has_cur_term() } -} - #[allow(non_snake_case)] pub fn ST_LOCAL() -> u64 { unsafe { C_ST_LOCAL() } @@ -35,7 +31,6 @@ pub fn _CS_PATH() -> i32 { extern "C" { fn C_MB_CUR_MAX() -> usize; - fn has_cur_term() -> bool; fn C_ST_LOCAL() -> u64; fn C_MNT_LOCAL() -> u64; fn C_CS_PATH() -> i32; diff --git a/fish-rust/src/proc.rs b/fish-rust/src/proc.rs index 21cca2c82..0752fa6a0 100644 --- a/fish-rust/src/proc.rs +++ b/fish-rust/src/proc.rs @@ -6,7 +6,7 @@ use crate::common::{ charptr2wcstring, escape, fputws, redirect_tty_output, scoped_push_replacer, timef, Timepoint, }; -use crate::compat::cur_term; +use crate::curses::term; use crate::env::Statuses; use crate::event::{self, Event}; use crate::flog::{FLOG, FLOGF}; @@ -1709,7 +1709,7 @@ fn process_clean_after_marking(parser: &Parser, allow_interactive: bool) -> bool // This may be invoked in an exit handler, after the TERM has been torn down // Don't try to print in that case (#3222) - let interactive = allow_interactive && cur_term(); + let interactive = allow_interactive && term().is_some(); // Remove all disowned jobs. remove_disowned_jobs(&mut parser.jobs_mut());