summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-11 08:14:08 +0800
committerGitHub <noreply@github.com>2024-04-11 08:14:08 +0800
commit4a88a3da04eca58cea59e42fbed86895d6053e62 (patch)
tree8da69c1119328447a785af990e81287669669eae
parent8feaf2a93ddd096bda497980debce640f56589d3 (diff)
downloadaichat-4a88a3da04eca58cea59e42fbed86895d6053e62.tar.gz
refactor: `ctrlc_exit` config default to false (#403)
-rw-r--r--README.md5
-rw-r--r--config.example.yaml2
-rw-r--r--src/config/mod.rs4
3 files changed, 7 insertions, 4 deletions
diff --git a/README.md b/README.md
index 717ecde..8844bd7 100644
--- a/README.md
+++ b/README.md
@@ -89,6 +89,7 @@ highlight: true # Set false to turn highlight
light_theme: false # Whether to use a light theme
wrap: no # Specify the text-wrapping mode (no, auto, <max-width>)
wrap_code: false # Whether wrap code block
+ctrlc_exit: false # Whether to exit REPL when Ctrl+C is pressed
auto_copy: false # Automatically copy the last output to the clipboard
keybindings: emacs # REPL keybindings. values: emacs, vi
prelude: '' # Set a default role or session (role:<name>, session:<name>)
@@ -155,7 +156,9 @@ aichat -s session1 --info # Session info
cat data.toml | aichat -c to json > data.json # Pipe stdio/stdout
-aichat -f a.png -f b.png diff images # Attach files
+aicaht -f data.toml -c to json > data.json # Attach files
+
+aichat -f a.png -f b.png diff images # Attach images
```
### Shell commands
diff --git a/config.example.yaml b/config.example.yaml
index 8d6052d..e423d37 100644
--- a/config.example.yaml
+++ b/config.example.yaml
@@ -6,7 +6,7 @@ highlight: true # Set false to turn highlight
light_theme: false # Whether to use a light theme
wrap: no # Specify the text-wrapping mode (no, auto, <max-width>)
wrap_code: false # Whether wrap code block
-ctrlc_exit: true # Whether to exit REPL by pressing Ctrl+C twice
+ctrlc_exit: false # Whether to exit REPL when Ctrl+C is pressed
auto_copy: false # Automatically copy the last output to the clipboard
keybindings: emacs # REPL keybindings. (emacs, vi)
prelude: '' # Set a default role or session (role:<name>, session:<name>)
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 1643b4e..6291d5c 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -62,7 +62,7 @@ pub struct Config {
pub wrap: Option<String>,
/// Whether wrap code block
pub wrap_code: bool,
- /// Whether to exit REPL by pressing Ctrl+C twice
+ /// Whether to exit REPL when Ctrl+C is pressed
pub ctrlc_exit: bool,
/// Automatically copy the last output to the clipboard
pub auto_copy: bool,
@@ -111,7 +111,7 @@ impl Default for Config {
light_theme: false,
wrap: None,
wrap_code: false,
- ctrlc_exit: true,
+ ctrlc_exit: false,
auto_copy: false,
keybindings: Default::default(),
prelude: String::new(),