From 172232352e6a7b50600b9f7d05a83506e8f5913e Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Fri, 19 Jul 2024 17:05:48 -0700 Subject: [PATCH 1/2] fix: add use-dev-tty to fix piping to yazi on mac --- Cargo.lock | 12 ++++++++++++ yazi-fm/Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index ad33f98ee..8f1921f4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -482,6 +482,7 @@ checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ "bitflags 2.6.0", "crossterm_winapi", + "filedescriptor", "futures-core", "libc", "mio", @@ -712,6 +713,17 @@ dependencies = [ "thiserror", ] +[[package]] +name = "filedescriptor" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7199d965852c3bac31f779ef99cbb4537f80e952e2d6aa0ffeb30cce00f4f46e" +dependencies = [ + "libc", + "thiserror", + "winapi", +] + [[package]] name = "filetime" version = "0.2.23" diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index 1c8e14ce2..5b45ad7a5 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -25,7 +25,7 @@ yazi-shared = { path = "../yazi-shared", version = "0.2.5" } # External dependencies anyhow = "1.0.86" better-panic = "0.3.0" -crossterm = { version = "0.27.0", features = [ "event-stream" ] } +crossterm = { version = "0.27.0", features = [ "event-stream", "use-dev-tty" ] } fdlimit = "0.3.0" futures = "0.3.30" mlua = { version = "0.9.9", features = [ "lua54" ] } From 5b5dac5dd8a1b2b1143738335afca04c31d8f483 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 20 Jul 2024 16:21:05 +0800 Subject: [PATCH 2/2] .. --- yazi-adapter/Cargo.toml | 3 +++ yazi-cli/Cargo.toml | 3 +++ yazi-config/Cargo.toml | 23 +++++++++++++---------- yazi-core/Cargo.toml | 3 +++ yazi-fm/Cargo.toml | 5 ++++- yazi-plugin/Cargo.toml | 3 +++ yazi-shared/Cargo.toml | 3 +++ 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/yazi-adapter/Cargo.toml b/yazi-adapter/Cargo.toml index f5fd1613a..502a6e32a 100644 --- a/yazi-adapter/Cargo.toml +++ b/yazi-adapter/Cargo.toml @@ -29,3 +29,6 @@ tokio = { version = "1.38.1", features = [ "full" ] } # Logging tracing = { version = "0.1.40", features = [ "max_level_debug", "release_max_level_warn" ] } + +[target.'cfg(target_os = "macos")'.dependencies] +crossterm = { version = "0.27.0", features = [ "use-dev-tty" ] } diff --git a/yazi-cli/Cargo.toml b/yazi-cli/Cargo.toml index 5cff311a7..805c3c41c 100644 --- a/yazi-cli/Cargo.toml +++ b/yazi-cli/Cargo.toml @@ -31,6 +31,9 @@ clap_complete_nushell = "4.5.2" serde_json = "1.0.120" vergen-gitcl = { version = "1.0.0", features = [ "build" ] } +[target.'cfg(target_os = "macos")'.dependencies] +crossterm = { version = "0.27.0", features = [ "use-dev-tty" ] } + [[bin]] name = "ya" path = "src/main.rs" diff --git a/yazi-config/Cargo.toml b/yazi-config/Cargo.toml index 12a121082..7800ed270 100644 --- a/yazi-config/Cargo.toml +++ b/yazi-config/Cargo.toml @@ -12,13 +12,16 @@ repository = "https://github.com/sxyazi/yazi" yazi-shared = { path = "../yazi-shared", version = "0.2.5" } # External dependencies -anyhow = "1.0.86" -arc-swap = "1.7.1" -bitflags = "2.6.0" -crossterm = "0.27.0" -globset = "0.4.14" -indexmap = "2.2.6" -ratatui = "0.27.0" -serde = { version = "1.0.204", features = [ "derive" ] } -toml = { version = "0.8.15", features = [ "preserve_order" ] } -validator = { version = "0.18.1", features = [ "derive" ] } +anyhow = "1.0.86" +arc-swap = "1.7.1" +bitflags = "2.6.0" +crossterm = "0.27.0" +globset = "0.4.14" +indexmap = "2.2.6" +ratatui = "0.27.0" +serde = { version = "1.0.204", features = [ "derive" ] } +toml = { version = "0.8.15", features = [ "preserve_order" ] } +validator = { version = "0.18.1", features = [ "derive" ] } + +[target.'cfg(target_os = "macos")'.dependencies] +crossterm = { version = "0.27.0", features = [ "use-dev-tty" ] } diff --git a/yazi-core/Cargo.toml b/yazi-core/Cargo.toml index ffbf4c5f2..fafb6fa0a 100644 --- a/yazi-core/Cargo.toml +++ b/yazi-core/Cargo.toml @@ -41,3 +41,6 @@ tracing = { version = "0.1.40", features = [ "max_level_debug", "release_max_lev [target."cfg(unix)".dependencies] libc = "0.2.155" + +[target.'cfg(target_os = "macos")'.dependencies] +crossterm = { version = "0.27.0", features = [ "use-dev-tty" ] } diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index 5b45ad7a5..160cccb5c 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -25,7 +25,7 @@ yazi-shared = { path = "../yazi-shared", version = "0.2.5" } # External dependencies anyhow = "1.0.86" better-panic = "0.3.0" -crossterm = { version = "0.27.0", features = [ "event-stream", "use-dev-tty" ] } +crossterm = { version = "0.27.0", features = [ "event-stream" ] } fdlimit = "0.3.0" futures = "0.3.30" mlua = { version = "0.9.9", features = [ "lua54" ] } @@ -45,6 +45,9 @@ tracing-subscriber = "0.3.18" libc = "0.2.155" signal-hook-tokio = { version = "0.3.1", features = [ "futures-v0_3" ] } +[target.'cfg(target_os = "macos")'.dependencies] +crossterm = { version = "0.27.0", features = [ "event-stream", "use-dev-tty" ] } + [target.'cfg(all(not(target_os = "macos"), not(target_os = "windows")))'.dependencies] tikv-jemallocator = "0.5.4" diff --git a/yazi-plugin/Cargo.toml b/yazi-plugin/Cargo.toml index 6db142c03..995652310 100644 --- a/yazi-plugin/Cargo.toml +++ b/yazi-plugin/Cargo.toml @@ -47,3 +47,6 @@ uzers = "0.12.0" [target."cfg(windows)".dependencies] clipboard-win = "5.4.0" + +[target.'cfg(target_os = "macos")'.dependencies] +crossterm = { version = "0.27.0", features = [ "use-dev-tty" ] } diff --git a/yazi-shared/Cargo.toml b/yazi-shared/Cargo.toml index 94483e389..aa6c78798 100644 --- a/yazi-shared/Cargo.toml +++ b/yazi-shared/Cargo.toml @@ -28,3 +28,6 @@ libc = "0.2.155" [target.'cfg(windows)'.dependencies] windows-sys = { version = "0.52.0", features = [ "Win32_Storage_FileSystem" ] } + +[target.'cfg(target_os = "macos")'.dependencies] +crossterm = { version = "0.27.0", features = [ "use-dev-tty" ] }