Skip to content

Commit 63f230f

Browse files
senekorextrawurst
authored andcommitted
fix freeze on copy with wl-copy
1 parent 3ceeb33 commit 63f230f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3939
* `edit` command duplication ([#1489](https://github.com/extrawurst/gitui/issues/1489))
4040
* syntax errors in `key_bindings.ron` will be logged ([#1491](https://github.com/extrawurst/gitui/issues/1491))
4141
* Fix UI freeze when copying with xclip installed on Linux ([#1497](https://github.com/extrawurst/gitui/issues/1497))
42+
* Fix UI freeze when copying with wl-copy installed on Linux ([#1497](https://github.com/extrawurst/gitui/issues/1497))
4243
* commit hooks report "command not found" on Windows with wsl2 installed ([#1528](https://github.com/extrawurst/gitui/issues/1528))
4344
* crashes on entering submodules ([#1510](https://github.com/extrawurst/gitui/issues/1510))
4445
* fix race issue: revlog messages sometimes appear empty ([#1473](https://github.com/extrawurst/gitui/issues/1473))

Diff for: src/clipboard.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,10 @@ fn exec_copy_with_args(
4949
}
5050
}
5151

52-
fn exec_copy(command: &str, text: &str) -> Result<()> {
53-
exec_copy_with_args(command, &[], text, true)
54-
}
55-
5652
#[cfg(all(target_family = "unix", not(target_os = "macos")))]
5753
pub fn copy_string(text: &str) -> Result<()> {
5854
if std::env::var("WAYLAND_DISPLAY").is_ok() {
59-
return exec_copy("wl-copy", text);
55+
return exec_copy_with_args("wl-copy", &[], text, false);
6056
}
6157

6258
if exec_copy_with_args(
@@ -78,6 +74,11 @@ pub fn copy_string(text: &str) -> Result<()> {
7874
Ok(())
7975
}
8076

77+
#[cfg(any(target_os = "macos", windows))]
78+
fn exec_copy(command: &str, text: &str) -> Result<()> {
79+
exec_copy_with_args(command, &[], text, true)
80+
}
81+
8182
#[cfg(target_os = "macos")]
8283
pub fn copy_string(text: &str) -> Result<()> {
8384
exec_copy("pbcopy", text)

0 commit comments

Comments
 (0)