Skip to content

Commit c2e8fe3

Browse files
committed
REF: Update release workflow and terminal handling
- Removed the unused `--target` flag from the packaging step in `release.yml` for simplifying configuration. - Improved terminal handling by introducing a `pending_write` buffer to manage channel writes efficiently. - Adjusted `TICK_RATE` in `main.rs` to improve UI responsiveness. - Incremented version from `0.1.3` to `0.1.4` in `Cargo.toml` and `Cargo.lock`.
1 parent dce929b commit c2e8fe3

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ jobs:
214214
run: |
215215
VERSION=${GITHUB_REF_NAME#v}
216216
vpk pack -u super-simple-ssh-client -v "$VERSION" \
217-
-p target/x86_64-pc-windows-gnu/release -e ss-ssh.exe -o dist \
218-
--target win-x64
217+
-p target/x86_64-pc-windows-gnu/release -e ss-ssh.exe -o dist
219218
- uses: actions/upload-artifact@v4
220219
with:
221220
name: windows-x86_64

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "super-simple-ssh-client"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
edition = "2024"
55
authors = ["hansen_docked_in <hansdrum@proton.me>"]
66
license = "MIT"

src/app/ssh_backend.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::collections::HashMap;
21
use std::path::Path;
32

43
use anyhow::{Context, Result};

src/app/terminal.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pub(crate) struct TerminalTab {
1515
pub(crate) parser: vt100::Parser,
1616
pub(crate) cols: u16,
1717
pub(crate) rows: u16,
18+
pub(crate) pending_write: Vec<u8>,
1819
}
1920

2021
impl App {
@@ -41,6 +42,7 @@ impl App {
4142
parser,
4243
cols: cols.max(1),
4344
rows: rows.max(1),
45+
pending_write: Vec::new(),
4446
};
4547
self.terminal_tabs.push(tab);
4648
self.active_terminal_tab = self.terminal_tabs.len();
@@ -78,8 +80,7 @@ impl App {
7880
.terminal_tabs
7981
.get_mut(self.active_terminal_tab.saturating_sub(1))
8082
{
81-
tab.channel.write_all(&bytes).ok();
82-
tab.channel.flush().ok();
83+
tab.pending_write.extend_from_slice(&bytes);
8384
}
8485
}
8586
Ok(true)
@@ -90,6 +91,19 @@ impl App {
9091
let mut err_buffer = [0u8; 1024];
9192
let mut closed = Vec::new();
9293
for (index, tab) in self.terminal_tabs.iter_mut().enumerate() {
94+
if !tab.pending_write.is_empty() {
95+
match tab.channel.write(&tab.pending_write) {
96+
Ok(0) => {}
97+
Ok(count) => {
98+
tab.pending_write.drain(0..count);
99+
}
100+
Err(err) => {
101+
if err.kind() != std::io::ErrorKind::WouldBlock {
102+
closed.push(index);
103+
}
104+
}
105+
}
106+
}
93107
loop {
94108
match tab.channel.read(&mut buffer) {
95109
Ok(0) => break,

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use app::App;
2121
use model::AppAction;
2222
use ui::constants::{HEADER_HEIGHT, TERMINAL_FOOTER_HEIGHT};
2323

24-
const TICK_RATE: Duration = Duration::from_millis(150);
24+
const TICK_RATE: Duration = Duration::from_millis(33);
2525

2626
fn main() -> Result<()> {
2727
let mut app = App::load_with_master()?;

0 commit comments

Comments
 (0)