summaryrefslogtreecommitdiff
path: root/crates/typst-cli/src/main.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-03-14 10:20:31 +0100
committerGitHub <noreply@github.com>2024-03-14 09:20:31 +0000
commit9e507cd9fd816f960a7f7ab4fe7472dc0f1aa143 (patch)
tree6d6b8e830096e791e10113f9ddce550416a4703b /crates/typst-cli/src/main.rs
parentc2ca3615d72ab6e7f2c29018f4a1e525b898e11d (diff)
Revert use of alternate screen (#3648)
Diffstat (limited to 'crates/typst-cli/src/main.rs')
-rw-r--r--crates/typst-cli/src/main.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/crates/typst-cli/src/main.rs b/crates/typst-cli/src/main.rs
index 3f5ca2aa..da0a57fd 100644
--- a/crates/typst-cli/src/main.rs
+++ b/crates/typst-cli/src/main.rs
@@ -19,7 +19,6 @@ use std::process::ExitCode;
use clap::Parser;
use codespan_reporting::term;
use codespan_reporting::term::termcolor::WriteColor;
-use ecow::eco_format;
use once_cell::sync::Lazy;
use crate::args::{CliArguments, Command};
@@ -46,13 +45,7 @@ fn main() -> ExitCode {
Command::Update(command) => crate::update::update(command),
};
- // Leave the alternate screen if it was opened. This operation is done here
- // so that it is executed prior to printing the final error.
- let res_leave = terminal::out()
- .leave_alternate_screen()
- .map_err(|err| eco_format!("failed to leave alternate screen ({err})"));
-
- if let Some(msg) = res.err().or(res_leave.err()) {
+ if let Err(msg) = res {
set_failed();
print_error(&msg).expect("failed to print error");
}