Skip to content

Commit 49d0a10

Browse files
committed
Adding new field subsystem to type Command
and update `native_mux_impl::Command::spawn` impl Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
1 parent 7d1232c commit 49d0a10

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/native_mux_impl/command.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@ use openssh_mux_client::{Connection, NonZeroByteSlice, Session};
1313
pub(crate) struct Command {
1414
cmd: Vec<u8>,
1515
ctl: Box<Path>,
16+
subsystem: bool,
1617

1718
stdin_v: Stdio,
1819
stdout_v: Stdio,
1920
stderr_v: Stdio,
2021
}
2122

2223
impl Command {
23-
pub(crate) fn new(ctl: Box<Path>, cmd: Vec<u8>) -> Self {
24+
pub(crate) fn new(ctl: Box<Path>, cmd: Vec<u8>, subsystem: bool) -> Self {
2425
Self {
2526
cmd,
2627
ctl,
28+
subsystem,
2729

2830
stdin_v: Stdio::inherit(),
2931
stdout_v: Stdio::inherit(),
@@ -71,7 +73,10 @@ impl Command {
7173

7274
let cmd = NonZeroByteSlice::new(&self.cmd).ok_or(Error::InvalidCommand)?;
7375

74-
let session = Session::builder().cmd(Cow::Borrowed(cmd)).build();
76+
let session = Session::builder()
77+
.cmd(Cow::Borrowed(cmd))
78+
.subsystem(self.subsystem)
79+
.build();
7580

7681
let established_session = Connection::connect(&self.ctl)
7782
.await?

0 commit comments

Comments
 (0)