Skip to content

Commit 5460923

Browse files
committed
feat: 修复 run 方法中的 raw 模式启用逻辑,确保清理函数正确设置
1 parent 2734d90 commit 5460923

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ostool/src/sterm/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ impl SerialTerm {
5555

5656
pub async fn run(&mut self) -> anyhow::Result<()> {
5757
// 启用raw模式
58-
enable_raw_mode()?;
58+
5959
// execute!(io::stdout(), Clear(ClearType::All))?;
6060

6161
// 设置清理函数
62-
let cleanup_needed = true;
62+
let cleanup_needed = enable_raw_mode().is_ok();
6363

6464
let result = self.run_terminal().await;
6565

0 commit comments

Comments
 (0)