From 4cfd6c8e9fd516167317de439c8136a7481dc2bb Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 27 Mar 2024 10:25:42 +0800 Subject: refactor: config add in_repl property (#381) --- src/repl/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/repl') diff --git a/src/repl/mod.rs b/src/repl/mod.rs index 1633774..0a601c7 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -74,6 +74,8 @@ pub struct Repl { impl Repl { pub fn init(config: &GlobalConfig) -> Result { + config.write().in_repl = true; + let editor = Self::create_editor(config)?; let prompt = ReplPrompt::new(config); @@ -212,7 +214,7 @@ impl Repl { self.config.write().clear_role()?; } Some("session") => { - self.config.write().end_session(true)?; + self.config.write().end_session()?; } Some(_) => unknown_command()?, None => { -- cgit v1.2.3