on master help sign in
Fix piping to Helix on macOS (#5468)
0e0501cJonathan
Cargo.lock+12
@@ -263,6 +263,7 @@ checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13"
263dependencies = [
263dependencies = [
264 "bitflags 1.3.2",
264 "bitflags 1.3.2",
265 "crossterm_winapi",
265 "crossterm_winapi",
266+ "filedescriptor",
266 "futures-core",
267 "futures-core",
267 "libc",
268 "libc",
268 "mio",
269 "mio",
@@ -427,6 +428,17 @@ dependencies = [
427 "log",
428 "log",
428]
429]
429
430
431+[[package]]
432+name = "filedescriptor"
433+version = "0.8.2"
434+source = "registry+https://github.com/rust-lang/crates.io-index"
435+checksum = "7199d965852c3bac31f779ef99cbb4537f80e952e2d6aa0ffeb30cce00f4f46e"
436+dependencies = [
437+ "libc",
438+ "thiserror",
439+ "winapi",
440+]
441+
430[[package]]
442[[package]]
431name = "filetime"
443name = "filetime"
432version = "0.2.21"
444version = "0.2.21"
helix-term/Cargo.toml+3
@@ -70,6 +70,9 @@ grep-searcher = "0.1.11"
70signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
70signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
71libc = "0.2.147"
71libc = "0.2.147"
72
72
73+[target.'cfg(target_os = "macos")'.dependencies]
74+crossterm = { version = "0.26", features = ["event-stream", "use-dev-tty"] }
75+
73[build-dependencies]
76[build-dependencies]
74helix-loader = { version = "0.6", path = "../helix-loader" }
77helix-loader = { version = "0.6", path = "../helix-loader" }
75
78
helix-term/src/application.rs−5
@@ -211,11 +211,6 @@ impl Application {
211 }
211 }
212 } else if stdin().is_tty() || cfg!(feature = "integration") {
212 } else if stdin().is_tty() || cfg!(feature = "integration") {
213 editor.new_file(Action::VerticalSplit);
213 editor.new_file(Action::VerticalSplit);
214− } else if cfg!(target_os = "macos") {
215− // On Linux and Windows, we allow the output of a command to be piped into the new buffer.
216− // This doesn't currently work on macOS because of the following issue:
217− // https://github.com/crossterm-rs/crossterm/issues/500
218− anyhow::bail!("Piping into helix-term is currently not supported on macOS");
219 } else {
214 } else {
220 editor
215 editor
221 .new_file_from_stdin(Action::VerticalSplit)
216 .new_file_from_stdin(Action::VerticalSplit)