summaryrefslogtreecommitdiffstats
path: root/src/config/mod.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-09 07:17:02 +0800
committerGitHub <noreply@github.com>2024-04-09 07:17:02 +0800
commit2738988fc47f0f068b6c78e556760a0dbca8d932 (patch)
tree7943fea61bc0650aa6fb1b6baeebe5d8a5a156b6 /src/config/mod.rs
parent3a0cafebd9965eec55864a0864684223d2fb3d8d (diff)
downloadaichat-2738988fc47f0f068b6c78e556760a0dbca8d932.tar.gz
feat: add `ctrlc_exit` option to control REPL exit by ctrl+c (#391)
Diffstat (limited to 'src/config/mod.rs')
-rw-r--r--src/config/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index b18bc74..1643b4e 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -62,6 +62,8 @@ pub struct Config {
pub wrap: Option<String>,
/// Whether wrap code block
pub wrap_code: bool,
+ /// Whether to exit REPL by pressing Ctrl+C twice
+ pub ctrlc_exit: bool,
/// Automatically copy the last output to the clipboard
pub auto_copy: bool,
/// REPL keybindings. (emacs, vi)
@@ -109,6 +111,7 @@ impl Default for Config {
light_theme: false,
wrap: None,
wrap_code: false,
+ ctrlc_exit: true,
auto_copy: false,
keybindings: Default::default(),
prelude: String::new(),