From eed916a0760e80225e73caecf1a4b4ab9855ddb1 Mon Sep 17 00:00:00 2001 From: tpeters Date: Wed, 24 May 2023 12:30:28 +0200 Subject: [PATCH] more: disable raw mode on error --- src/uu/more/src/more.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index b5487ef87..8c6cdf6e2 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -106,10 +106,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { } let opened_file = match File::open(file) { Err(why) => { + terminal::disable_raw_mode().unwrap(); return Err(USimpleError::new( 1, format!("cannot open {}: {}", file.quote(), why.kind()), - )) + )); } Ok(opened_file) => opened_file, };