| Crates.io | gpui-terminal |
| lib.rs | gpui-terminal |
| version | 0.1.0 |
| created_at | 2025-12-24 04:23:12.603578+00 |
| updated_at | 2025-12-24 04:23:12.603578+00 |
| description | Terminal emulator component for gpui |
| homepage | |
| repository | https://github.com/zortax/gpui-terminal |
| max_upload_size | |
| id | 2002736 |
| size | 362,647 |
A terminal emulator component for GPUI applications. Uses alacritty_terminal for VTE parsing.
Read/Write streams (not tied to a specific PTY library)use gpui_terminal::{TerminalConfig, TerminalView, ColorPalette};
// Create terminal with PTY reader/writer
let terminal = cx.new(|cx| {
TerminalView::new(pty_writer, pty_reader, config, cx)
.with_resize_callback(|cols, rows| {
// Notify PTY of size change
})
.with_exit_callback(|_window, cx| {
cx.quit();
})
});
See src/main.rs for a complete example using portable-pty.
let colors = ColorPalette::builder()
.background(0x16, 0x16, 0x17)
.foreground(0xC9, 0xC7, 0xCD)
.cursor(0xC9, 0xC7, 0xCD)
.black(0x10, 0x10, 0x10)
// ... other colors
.build();
let config = TerminalConfig {
font_family: "Mononoki Nerd Font".into(),
font_size: px(14.0),
cols: 80,
rows: 24,
scrollback: 10000,
line_height_multiplier: 1.05,
padding: Edges::all(px(8.0)),
colors,
};
MIT OR Apache-2.0