Skip to content
Merged
92 changes: 92 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: coverage

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
coverage:
name: coverage
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: llvm-tools-preview

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: codecov-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
curl \
dpkg \
rpm \
libxcb1-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libssl-dev \
zlib1g-dev

- uses: taiki-e/install-action@cargo-llvm-cov

- name: Run tests with coverage instrumentation
run: cargo llvm-cov --workspace --all-features --no-report

- name: Generate LCOV report
run: cargo llvm-cov report --lcov --output-path lcov.info

- name: Generate HTML report
run: cargo llvm-cov report --html --output-dir coverage-html

- name: Generate text summary
run: cargo llvm-cov report > coverage-summary.txt

- name: Publish coverage summary
run: |
echo '## Coverage Summary' >> "$GITHUB_STEP_SUMMARY"
echo '```text' >> "$GITHUB_STEP_SUMMARY"
cat coverage-summary.txt >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"

- name: Upload LCOV artifact
uses: actions/upload-artifact@v4
with:
name: coverage-lcov
path: lcov.info
if-no-files-found: error

- name: Upload HTML artifact
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: coverage-html
if-no-files-found: error

- name: Upload to codecov.io
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
slug: iamazy/termua
35 changes: 12 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
<p align="center">
English | <a href="./README.zh-CN.md">简体中文</a>
</p>
<div align="center">
<h1>Termua</h1>
<h4>
an open-source cross-platform terminal application built with <a href="https://github.com/zed-industries/zed">GPUI</a> <br/>and powered by the <a href="https://github.com/alacritty/alacritty">Alacritty</a> / <a href="https://github.com/wezterm/wezterm">WezTerm</a> terminal backends.
</h4>

<p align="center">
<img src="./assets/logo/termua.svg" alt="Termua Logo" width="120" />
</p>
[![codecov](https://codecov.io/github/iamazy/termua/graph/badge.svg?token=QRH8H0O6P5)](https://codecov.io/github/iamazy/termua)
![License](https://img.shields.io/badge/license-AGPL--3.0-blue)

<p align="center">
an open-source cross-platform terminal application built with <a href="https://github.com/zed-industries/zed">GPUI</a> and powered by the <a href="https://github.com/alacritty/alacritty">Alacritty</a> / <a href="https://github.com/wezterm/wezterm">WezTerm</a> terminal backends.
</p>

<p>
<div align="center">
<a href="https://github.com/iamazy/termua/releases">
<img alt="Linux" src="https://img.shields.io/badge/-Linux-yellow?style=flat-square&logo=linux&logoColor=black&color=orange" />
</a>
<a href="https://github.com/iamazy/termua/releases">
<img alt="Windows" src="https://img.shields.io/badge/-Windows-blue?style=flat-square&logo=windows&logoColor=white" />
</a>
<a href="https://github.com/iamazy/termua/releases">
<img alt="macOS" src="https://img.shields.io/badge/-macOS-black?style=flat-square&logo=apple&logoColor=white" />
</a>
</div>
</p>
</div>

<div align="center">
<img src="assets/screenshot/screenshot.png" alt="termua" height="500" style="border-radius: 16px;" />
</div>

<p align="center">
English | <a href="./README.zh-CN.md">简体中文</a>
</p>

### Features ❇️

- [x] Cross-platform: Linux / macOS / Windows
Expand Down
40 changes: 14 additions & 26 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
<p align="center">
<a href="./README.md">English</a> | 简体中文
</p>

<p align="center">
<img src="./assets/logo/termua.svg" alt="Termua Logo" width="120" />
</p>

<p align="center">
<span style="font: bold; font-size: larger">Termua:</span> 一款使用 <a href="https://github.com/zed-industries/zed">GPUI</a> 构建,基于 <a href="https://github.com/alacritty/alacritty">Alacritty</a> / <a href="https://github.com/wezterm/wezterm">Wezterm</a> 内核的开源跨平台终端应用。
</p>

<p align="center">
<div align="center">
<h1>Termua</h1>
<h4>
一款使用 <a href="https://github.com/zed-industries/zed">GPUI</a> 构建,基于 <a href="https://github.com/alacritty/alacritty">Alacritty</a> / <a href="https://github.com/wezterm/wezterm">Wezterm</a> 内核的开源跨平台终端应用
</h4>
<p align="center">
集成 SSH / Serial / SFTP / 回放 / 终端共享 / AI 助手,目标是成为一个现代化的终端工作台。
</p>

<p>
<div align="center">
<a href="https://github.com/iamazy/termua/releases">
<img alt="Linux" src="https://img.shields.io/badge/-Linux-yellow?style=flat-square&logo=linux&logoColor=black&color=orange" />
</a>
<a href="https://github.com/iamazy/termua/releases">
<img alt="Windows" src="https://img.shields.io/badge/-Windows-blue?style=flat-square&logo=windows&logoColor=white" />
</a>
<a href="https://github.com/iamazy/termua/releases">
<img alt="macOS" src="https://img.shields.io/badge/-macOS-black?style=flat-square&logo=apple&logoColor=white" />
</a>
</div>
</p>
[![codecov](https://codecov.io/github/iamazy/termua/graph/badge.svg?token=QRH8H0O6P5)](https://codecov.io/github/iamazy/termua)
![License](https://img.shields.io/badge/license-AGPL--3.0-blue)

</div>

<div align="center">
<img src="assets/screenshot/screenshot.png" alt="termua" height="500" style="border-radius: 16px;" />
</div>

<p align="center">
<a href="./README.md">English</a> | 简体中文
</p>

### 特性 ❇️

- [x] 跨平台:Linux / macOS / Windows
Expand Down
38 changes: 5 additions & 33 deletions crates/gpui_term/examples/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ use gpui::{
};
use gpui_component::Root;
use gpui_component_assets::Assets;
use gpui_term::{
Authentication, CursorShape, PtySource, SshOptions, TerminalBuilder, TerminalType, TerminalView,
};
use gpui_term::{CursorShape, TerminalBuilder, TerminalType, TerminalView};

fn main() {
env_logger::init();
Expand All @@ -25,39 +23,13 @@ fn main() {
if std::env::var_os("WAYLAND_DISPLAY").is_some() {
window.set_background_appearance(WindowBackgroundAppearance::Transparent);
}
// let terminal = cx.new(|cx| {
// TerminalBuilder::new(
// TerminalType::Alacritty,
// std::collections::HashMap::default(),
// CursorShape::default(),
// None,
// 0,
// None,
// )
// .unwrap()
// .subscribe(cx)
// });
let terminal = cx.new(|cx| {
TerminalBuilder::new_with_pty(
TerminalType::WezTerm,
PtySource::Ssh {
env: HashMap::default(),
opts: SshOptions {
host: "127.0.0.1".to_string(),
port: Some(22),
auth: Authentication::Password(
"iamazy".to_string(),
"1448588084".to_string(),
),
proxy: gpui_term::SshProxyMode::Inherit,
backend: gpui_term::SshBackend::default(),
tcp_nodelay: false,
tcp_keepalive: false,
},
},
TerminalBuilder::new(
TerminalType::Alacritty,
HashMap::default(),
CursorShape::default(),
None,
None,
0,
)
.unwrap()
.subscribe(cx)
Expand Down
Loading
Loading