Fix startup command and holder fallback
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled

This commit is contained in:
DuProcess
2026-06-26 19:31:33 -04:00
parent 60d73df5be
commit 4842a129f2
2 changed files with 14 additions and 9 deletions
+9 -8
View File
@@ -1048,7 +1048,7 @@ fn startup_command(args: &[String]) -> Option<Vec<u8>> {
return None;
}
let mut command = args.join(" ");
command.push('\n');
command.push('\r');
Some(command.into_bytes())
}
@@ -1121,7 +1121,7 @@ fn expand_command_extension(template: &str, args: &[String]) -> String {
fn startup_command_from_string(command: &str) -> Vec<u8> {
let mut command = command.to_string();
command.push('\n');
command.push('\r');
command.into_bytes()
}
@@ -5540,6 +5540,7 @@ mod tests {
assert!(Predictor::predictable(b"hello world"));
assert!(!Predictor::predictable(b""));
assert!(!Predictor::predictable(b"\n"));
assert!(!Predictor::predictable(b"\r"));
assert!(!Predictor::predictable(b"\x1b[A"));
assert!(!Predictor::predictable("snowman: \u{2603}".as_bytes()));
assert!(!Predictor::predictable("wide: 你".as_bytes()));
@@ -5760,10 +5761,10 @@ mod tests {
#[test]
fn startup_command_joins_args_for_remote_shell() {
assert_eq!(startup_command(&[]), None);
assert_eq!(startup_command(&["tm".to_string()]), Some(b"tm\n".to_vec()));
assert_eq!(startup_command(&["tm".to_string()]), Some(b"tm\r".to_vec()));
assert_eq!(
startup_command(&["tm".to_string(), "work".to_string()]),
Some(b"tm work\n".to_vec())
Some(b"tm work\r".to_vec())
);
}
@@ -5845,7 +5846,7 @@ mod tests {
assert_eq!(
resolved_startup_command(&["tm".into(), "work space".into()], &config, &host),
Some(b"tm 'work space'\n".to_vec())
Some(b"tm 'work space'\r".to_vec())
);
}
@@ -5872,7 +5873,7 @@ mod tests {
assert_eq!(
resolved_startup_command(&["tm".into(), "dosh".into()], &config, &host),
Some(b"/opt/tm/bin/tm --remote 'dosh'\n".to_vec())
Some(b"/opt/tm/bin/tm --remote 'dosh'\r".to_vec())
);
}
@@ -5913,11 +5914,11 @@ mod tests {
assert_eq!(
resolved_startup_command(&["echo".into(), "ok".into()], &config, &host),
Some(b"echo ok\n".to_vec())
Some(b"echo ok\r".to_vec())
);
assert_eq!(
resolved_startup_command(&[], &config, &host),
Some(b"tm\n".to_vec())
Some(b"tm\r".to_vec())
);
host.default_command = None;