diff --git a/CHANGELOG.md b/CHANGELOG.md index c8c3ff1822..0da7be0a1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `edit` command duplication ([#1489](https://github.com/extrawurst/gitui/issues/1489)) * syntax errors in `key_bindings.ron` will be logged ([#1491](https://github.com/extrawurst/gitui/issues/1491)) * Fix UI freeze when copying with xclip installed on Linux ([#1497](https://github.com/extrawurst/gitui/issues/1497)) +* Fix UI freeze when copying with wl-copy installed on Linux ([#1497](https://github.com/extrawurst/gitui/issues/1497)) * commit hooks report "command not found" on Windows with wsl2 installed ([#1528](https://github.com/extrawurst/gitui/issues/1528)) * crashes on entering submodules ([#1510](https://github.com/extrawurst/gitui/issues/1510)) * fix race issue: revlog messages sometimes appear empty ([#1473](https://github.com/extrawurst/gitui/issues/1473)) diff --git a/src/clipboard.rs b/src/clipboard.rs index 2d492701f9..bf961d2065 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -49,14 +49,10 @@ fn exec_copy_with_args( } } -fn exec_copy(command: &str, text: &str) -> Result<()> { - exec_copy_with_args(command, &[], text, true) -} - #[cfg(all(target_family = "unix", not(target_os = "macos")))] pub fn copy_string(text: &str) -> Result<()> { if std::env::var("WAYLAND_DISPLAY").is_ok() { - return exec_copy("wl-copy", text); + return exec_copy_with_args("wl-copy", &[], text, false); } if exec_copy_with_args( @@ -78,6 +74,11 @@ pub fn copy_string(text: &str) -> Result<()> { Ok(()) } +#[cfg(any(target_os = "macos", windows))] +fn exec_copy(command: &str, text: &str) -> Result<()> { + exec_copy_with_args(command, &[], text, true) +} + #[cfg(target_os = "macos")] pub fn copy_string(text: &str) -> Result<()> { exec_copy("pbcopy", text)