summaryrefslogtreecommitdiffstats
path: root/src/repl/mod.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-03-27 10:25:42 +0800
committerGitHub <noreply@github.com>2024-03-27 10:25:42 +0800
commit4cfd6c8e9fd516167317de439c8136a7481dc2bb (patch)
tree1b7ed83b4284bdf29d628e6a56d86985cfe2d5ef /src/repl/mod.rs
parentbd9a6a87254bb2748beb9cd3b58ea15be6c9686c (diff)
downloadaichat-4cfd6c8e9fd516167317de439c8136a7481dc2bb.tar.gz
refactor: config add in_repl property (#381)
Diffstat (limited to 'src/repl/mod.rs')
-rw-r--r--src/repl/mod.rs4
1 files changed, 3 insertions, 1 deletions
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<Self> {
+ 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 => {