https://github.com/tnze/tauri-plugin-pty
A Tauri2 plugin for embedding a terminal in your application
https://github.com/tnze/tauri-plugin-pty
pty shell tauri-plugin terminal
Last synced: 5 months ago
JSON representation
A Tauri2 plugin for embedding a terminal in your application
- Host: GitHub
- URL: https://github.com/tnze/tauri-plugin-pty
- Owner: Tnze
- Created: 2023-12-21T13:35:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-22T17:29:33.000Z (10 months ago)
- Last Synced: 2025-09-23T11:52:59.621Z (9 months ago)
- Topics: pty, shell, tauri-plugin, terminal
- Language: TypeScript
- Homepage:
- Size: 734 KB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tauri Plugin Pseudo Terminal
Developing! Wellcome to contribute!
## Example
Full example at:
```sh
# Install this plugin in your Cargo.toml
cargo add tauri-plugin-pty
# Install the api package
npm install tauri-pty
```
```rust
tauri::Builder::default()
.plugin(tauri_plugin_pty::init()) // add this
.run(tauri::generate_context!())
.expect("error while running tauri application");
...
```
```typescript
import { Terminal } from "xterm"
import { spawn } from "tauri-pty";
// init xterm.js
const term = new Terminal();
term.open(/* DOM Elem */);
// spawn shell
const pty = spawn("powershell.exe", [/* args */], {
cols: term.cols,
rows: term.rows,
})
// transport data
pty.onData(data => term.write(data))
term.onData(data => pty.write(data))
```