summaryrefslogtreecommitdiffstats
path: root/src/repl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/repl.rs')
-rw-r--r--src/repl.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/repl.rs b/src/repl.rs
index 2ca1ea0..cd9e990 100644
--- a/src/repl.rs
+++ b/src/repl.rs
@@ -1,7 +1,7 @@
use crate::client::ChatGptClient;
use crate::config::{Config, Role};
-use crate::editor;
use crate::render::{self, MarkdownRender};
+use crate::term;
use crate::utils::{copy, dump};
use anyhow::{anyhow, Result};
use crossbeam::channel::{unbounded, Sender};
@@ -115,7 +115,7 @@ impl Repl {
dump_repl_help();
}
".clear" => match args {
- Some("screen") => self.editor.clear_scrollback()?,
+ Some("screen") => term::clear_screen(0)?,
Some("history") => {
let history = Box::new(self.editor.history_mut());
history
@@ -139,7 +139,7 @@ impl Repl {
"// Entering editor mode (Ctrl+D to finish, Ctrl+C to cancel)",
1,
);
- let content = editor::edit()?;
+ let content = term::edit()?;
dump("", 1);
handler.handle(ReplCmd::Submit(content))?;
}
@@ -189,6 +189,11 @@ impl Repl {
ReedlineEvent::MenuNext,
]),
);
+ keybindings.add_binding(
+ KeyModifiers::CONTROL,
+ KeyCode::Char('l'),
+ ReedlineEvent::ExecuteHostCommand(".clear screen".into()),
+ );
keybindings
}