Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: abandon auto_copy #607

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ highlight: true # Controls syntax highlighting
light_theme: false # Activates a light color theme when true
wrap: no # Controls text wrapping (no, auto, <max-width>)
wrap_code: false # Enables or disables wrapping of code blocks
auto_copy: false # Enables or disables automatic copying the last LLM response to the clipboard
keybindings: emacs # Choose keybinding style (emacs, vi)
prelude: null # Set a default role or session to start with (role:<name>, session:<name>)

Expand Down
1 change: 0 additions & 1 deletion config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ highlight: true # Controls syntax highlighting
light_theme: false # Activates a light color theme when true. ENV: AICHAT_LIGHT_THEME
wrap: no # Controls text wrapping (no, auto, <max-width>)
wrap_code: false # Enables or disables wrapping of code blocks
auto_copy: false # Enables or disables automatic copying the last LLM response to the clipboard
keybindings: emacs # Choose keybinding style (emacs, vi)

prelude: null # Set a default role or session to start with (e.g. role:<name>, session:<name>)
Expand Down
19 changes: 0 additions & 19 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ pub struct Config {
pub light_theme: bool,
pub wrap: Option<String>,
pub wrap_code: bool,
pub auto_copy: bool,
pub keybindings: Keybindings,
pub prelude: Option<String>,
pub repl_prelude: Option<String>,
Expand Down Expand Up @@ -146,7 +145,6 @@ impl Default for Config {
light_theme: false,
wrap: None,
wrap_code: false,
auto_copy: false,
keybindings: Default::default(),
prelude: None,
repl_prelude: None,
Expand Down Expand Up @@ -450,7 +448,6 @@ impl Config {
("light_theme", self.light_theme.to_string()),
("wrap", wrap),
("wrap_code", self.wrap_code.to_string()),
("auto_copy", self.auto_copy.to_string()),
("keybindings", self.keybindings.stringify().into()),
("prelude", format_option_value(&self.prelude)),
("config_file", display_path(&Self::config_file()?)),
Expand Down Expand Up @@ -518,10 +515,6 @@ impl Config {
let value = value.parse().with_context(|| "Invalid value")?;
self.dry_run = value;
}
"auto_copy" => {
let value = value.parse().with_context(|| "Invalid value")?;
self.auto_copy = value;
}
_ => bail!("Unknown key `{key}`"),
}
Ok(())
Expand Down Expand Up @@ -1048,7 +1041,6 @@ impl Config {
"save_session",
"highlight",
"dry_run",
"auto_copy",
]
.into_iter()
.map(|v| (format!("{v} "), None))
Expand All @@ -1074,7 +1066,6 @@ impl Config {
}
"highlight" => complete_bool(self.highlight),
"dry_run" => complete_bool(self.dry_run),
"auto_copy" => complete_bool(self.auto_copy),
_ => vec![],
};
(values.into_iter().map(|v| (v, None)).collect(), args[1])
Expand Down Expand Up @@ -1172,9 +1163,6 @@ impl Config {
output.insert("wrap", wrap.clone());
}
}
if self.auto_copy {
output.insert("auto_copy", "true".to_string());
}
if !role.is_derived() {
output.insert("role", role.name().to_string());
}
Expand Down Expand Up @@ -1232,7 +1220,6 @@ impl Config {
input.clear_patch_text();
self.last_message = Some((input.clone(), output.to_string(), self.bot.is_some()));
self.save_message(input, output, tool_results)?;
self.maybe_copy(output);
Ok(())
}

Expand Down Expand Up @@ -1281,12 +1268,6 @@ impl Config {
.with_context(|| "Failed to save message")
}

fn maybe_copy(&self, text: &str) {
if self.auto_copy {
let _ = set_text(text);
}
}

fn open_message_file(&self) -> Result<File> {
let path = self.messages_file()?;
ensure_parent_exists(&path)?;
Expand Down