Avoid PTY allocation for forward-only mode
ci / test (push) Has been cancelled
ci / remote-bench (push) Has been cancelled

This commit is contained in:
DuProcess
2026-06-13 22:18:15 -04:00
parent 7fec3592f5
commit 76e2e980f1
2 changed files with 105 additions and 44 deletions
+5 -3
View File
@@ -186,7 +186,9 @@ async fn main() -> Result<()> {
!local_forwards.is_empty() || !remote_forwards.is_empty() || !dynamic_forwards.is_empty();
let predict = args.predict || host.predict.unwrap_or(config.predict);
let session = select_session(args.session.as_deref(), args.new);
let mode = if args.view_only || config.view_only {
let mode = if args.forward_only {
"forward-only"
} else if args.view_only || config.view_only {
"view-only"
} else {
"read-write"
@@ -1945,7 +1947,7 @@ async fn run_terminal(
if bytes == [0x1d] {
break;
}
if cred.mode != "view-only" {
if cred.mode != "view-only" && cred.mode != "forward-only" {
predictor.observe_input(&bytes)?;
send_input(&socket, addr, &cred, &mut send_seq, bytes).await?;
}
@@ -1958,7 +1960,7 @@ async fn run_terminal(
&& (cols, rows) != last_size
{
last_size = (cols, rows);
if cred.mode != "view-only" {
if cred.mode != "view-only" && cred.mode != "forward-only" {
send_resize(&socket, addr, &cred, &mut send_seq, cols, rows).await?;
}
}