Skip to content

Commit 242ca5e

Browse files
committed
Add a toggleable integrated terminal
This commit adds the `helix-integrated-terminal` crate, which handles the PTY creation and view logic for an integrated terminal in Helix, using the `alacritty_terminal` crate. The terminal can be opened using the `:term` command, and the terminal can be exited by either using `exit` in the terminal itself, or by using `C-q` twice. The current implementation is as a pop-up, but in the future, we may be able to expose the terminal as a `View`, if work is done to decouple the `Document` attachment to `View`. Signed-off-by: Ryan Brue <[email protected]>
1 parent 456ea31 commit 242ca5e

File tree

20 files changed

+1446
-14
lines changed

20 files changed

+1446
-14
lines changed

Cargo.lock

Lines changed: 199 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ members = [
44
"helix-core",
55
"helix-graphics",
66
"helix-input",
7+
"helix-integrated-terminal",
78
"helix-view",
89
"helix-term",
910
"helix-tui",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[package]
2+
name = "helix-integrated-terminal"
3+
description = "An integrated terminal for Helix, using alacritty_terminal."
4+
version.workspace = true
5+
authors.workspace = true
6+
edition.workspace = true
7+
license.workspace = true
8+
rust-version.workspace = true
9+
categories.workspace = true
10+
repository.workspace = true
11+
homepage.workspace = true
12+
13+
[dependencies]
14+
helix-input = { path = "../helix-input" }
15+
helix-graphics = { path = "../helix-graphics" }
16+
helix-lsp = { path = "../helix-lsp" }
17+
18+
futures = "0.3"
19+
thiserror.workspace = true
20+
tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] }
21+
anyhow = "1"
22+
log = "~0.4"
23+
alacritty_terminal = "0.25.1"
24+
polling = "3.11.0"
25+
26+
[target.'cfg(target_os = "linux")'.dependencies]
27+
libc = "0.2.177"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#[derive(Debug, thiserror::Error)]
2+
pub enum Error {
3+
#[error("Pty Error: {0}")]
4+
PtyError(#[from] anyhow::Error),
5+
6+
#[error("IO Error: {0}")]
7+
IoError(#[from] std::io::Error),
8+
9+
#[error("Terminal Not Found: {0}")]
10+
TerminalNotFound(u32),
11+
12+
#[error("MPSC Sender error: {0}")]
13+
SendError(#[from] tokio::sync::mpsc::error::SendError<alacritty_terminal::event_loop::Msg>),
14+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub mod error;
2+
pub mod pty;
3+
pub mod terminal;

0 commit comments

Comments
 (0)