aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/config
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-07-22 18:31:35 +0000
committerGitHub <noreply@github.com>2023-07-22 18:31:35 +0000
commit0c94e4ae7b413a8ae4e37882f0d483d2e259bd44 (patch)
treee689b92d23d0b61b6c83d00d329581d51ecd296a /alacritty_terminal/src/config
parentf2e543880f75f92421e34a186ea44d8f32cbd52a (diff)
downloadr-alacritty-0c94e4ae7b413a8ae4e37882f0d483d2e259bd44.tar.gz
r-alacritty-0c94e4ae7b413a8ae4e37882f0d483d2e259bd44.tar.bz2
r-alacritty-0c94e4ae7b413a8ae4e37882f0d483d2e259bd44.zip
Add `terminal` config section to control OSCs
Some environments demand certain OSC sequences to be disabled or some escape sequence could require handling which is out of scope of alacritty, but could be done by external script (OSC 777). Added section for now just handles the `OSC 52` sequence and changes its default to be `OnlyCopy`, which is handy for remote copy, but `Paste` is redundant because normal `Paste` hotkey could be used as well. Fixes #3386. Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty_terminal/src/config')
-rw-r--r--alacritty_terminal/src/config/mod.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/alacritty_terminal/src/config/mod.rs b/alacritty_terminal/src/config/mod.rs
index 80be4d16..e70389ec 100644
--- a/alacritty_terminal/src/config/mod.rs
+++ b/alacritty_terminal/src/config/mod.rs
@@ -31,11 +31,36 @@ pub struct Config {
/// Cursor configuration.
pub cursor: Cursor,
+ /// Terminal specific settings.
+ pub terminal: Terminal,
+
#[config(flatten)]
pub pty_config: PtyConfig,
}
#[derive(ConfigDeserialize, Clone, Debug, PartialEq, Eq, Default)]
+pub struct Terminal {
+ // OSC 52 handling (clipboard handling).
+ pub osc52: Osc52,
+}
+
+#[derive(ConfigDeserialize, Clone, Debug, PartialEq, Eq, Default)]
+pub enum Osc52 {
+ /// The handling of the escape sequence is disabled.
+ Disabled,
+ /// Only copy sequence is accepted.
+ ///
+ /// This option is the default as a compromiss between entirely
+ /// disabling it (the most secure) and allowing `paste` (the less secure).
+ #[default]
+ OnlyCopy,
+ /// Only paste sequence is accepted.
+ OnlyPaste,
+ /// Both are accepted.
+ CopyPaste,
+}
+
+#[derive(ConfigDeserialize, Clone, Debug, PartialEq, Eq, Default)]
pub struct PtyConfig {
/// Path to a shell program to run on startup.
pub shell: Option<Program>,