Skip to content

Commit

Permalink
build: upgrade portable-pty
Browse files Browse the repository at this point in the history
  • Loading branch information
arxanas committed Mar 14, 2023
1 parent 3eee58a commit fc998aa
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
22 changes: 20 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion git-branchless-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ itertools = "0.10.5"
lazy_static = "1.4.0"
lib = { package = "git-branchless-lib", version = "0.7.0", path = "../git-branchless-lib" }
once_cell = "1.17.1"
portable-pty = "0.7.0"
portable-pty = "0.8.1"
regex = "1.7.1"
tempfile = "3.4.0"
tracing = "0.1.37"
Expand Down
10 changes: 7 additions & 3 deletions git-branchless-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,13 @@ pub mod pty {
// Use the native pty implementation for the system
let pty_system = native_pty_system();
let pty_size = PtySize::default();
let mut pty = pty_system
let pty = pty_system
.openpty(pty_size)
.map_err(|e| eyre!("Could not open pty: {}", e))?;
let mut pty_master = pty
.master
.take_writer()
.map_err(|e| eyre!("Could not take PTY master writer: {e}"))?;

// Spawn a git instance in the pty.
let mut cmd = CommandBuilder::new(&git.path_to_git);
Expand Down Expand Up @@ -877,8 +881,8 @@ Screen contents:
}

PtyAction::Write(value) => {
write!(pty.master, "{value}")?;
pty.master.flush()?;
write!(pty_master, "{value}")?;
pty_master.flush()?;
}
}
}
Expand Down

0 comments on commit fc998aa

Please sign in to comment.