Skip to content

Commit

Permalink
Enable crossterm's dev-tty feature
Browse files Browse the repository at this point in the history
This fixes piping to Helix on macos.
Also remove the error message preventing this usage.
  • Loading branch information
yyogo committed Jun 13, 2023
1 parent 37fcd16 commit 8ff2f01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion helix-term/Cargo.toml
Expand Up @@ -37,7 +37,7 @@ which = "4.4"

tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] }
tui = { path = "../helix-tui", package = "helix-tui", default-features = false, features = ["crossterm"] }
crossterm = { version = "0.26", features = ["event-stream"] }
crossterm = { version = "0.26", features = ["event-stream", "use-dev-tty"] }
signal-hook = "0.3"
tokio-stream = "0.1"
futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false }
Expand Down
5 changes: 0 additions & 5 deletions helix-term/src/application.rs
Expand Up @@ -215,11 +215,6 @@ impl Application {
}
} else if stdin().is_tty() || cfg!(feature = "integration") {
editor.new_file(Action::VerticalSplit);
} else if cfg!(target_os = "macos") {
// On Linux and Windows, we allow the output of a command to be piped into the new buffer.
// This doesn't currently work on macOS because of the following issue:
// https://github.com/crossterm-rs/crossterm/issues/500
anyhow::bail!("Piping into helix-term is currently not supported on macOS");
} else {
editor
.new_file_from_stdin(Action::VerticalSplit)
Expand Down

0 comments on commit 8ff2f01

Please sign in to comment.