aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
authorCharlie Groves2022-11-02 01:12:40 +0000
committerGitHub2022-11-02 01:12:40 +0000
commit1bed2f30435cfa45502ad2c481a1f4ffe4a1119a (patch)
treeb993c56c7bb5009055e3bd2bf1f17ef15df921ef /helix-view/src/editor.rs
parentb156f5761804a7e9a95268f80ff5e34dea783200 (diff)
Use OSC 52 as a fallback for setting the system clipboard (#3220)
This adds a simple base64 implementation to keep us from adding a crate for one function. It's mostly based on https://github.com/marshallpierce/rust-base64/blob/a675443d327e175f735a37f574de803d6a332591/src/engine/naive.rs#L42
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index af69ceea..47edf303 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -187,9 +187,9 @@ pub struct TerminalConfig {
#[cfg(windows)]
pub fn get_terminal_provider() -> Option<TerminalConfig> {
- use crate::clipboard::provider::command::exists;
+ use crate::env::binary_exists;
- if exists("wt") {
+ if binary_exists("wt") {
return Some(TerminalConfig {
command: "wt".to_string(),
args: vec![
@@ -210,16 +210,16 @@ pub fn get_terminal_provider() -> Option<TerminalConfig> {
#[cfg(not(any(windows, target_os = "wasm32")))]
pub fn get_terminal_provider() -> Option<TerminalConfig> {
- use crate::clipboard::provider::command::{env_var_is_set, exists};
+ use crate::env::{binary_exists, env_var_is_set};
- if env_var_is_set("TMUX") && exists("tmux") {
+ if env_var_is_set("TMUX") && binary_exists("tmux") {
return Some(TerminalConfig {
command: "tmux".to_string(),
args: vec!["split-window".to_string()],
});
}
- if env_var_is_set("WEZTERM_UNIX_SOCKET") && exists("wezterm") {
+ if env_var_is_set("WEZTERM_UNIX_SOCKET") && binary_exists("wezterm") {
return Some(TerminalConfig {
command: "wezterm".to_string(),
args: vec!["cli".to_string(), "split-pane".to_string()],