Skip to content

Commit adbb963

Browse files
Handle newlines properly in launch profiles
1 parent fab4da8 commit adbb963

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src-tauri/src/util.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,14 @@ pub(crate) fn gen_launch_command(base_cmd: Command, launch_fmt: &str) -> Result<
505505
base_command_str.push_str(arg.to_string_lossy().to_string().as_str());
506506
}
507507

508+
let mut launch_command_str = launch_fmt.to_string();
509+
510+
// Replace newlines with spaces
511+
launch_command_str = launch_command_str.replace("\r\n", " ");
512+
launch_command_str = launch_command_str.replace("\n", " ");
513+
508514
// Substitute the base command + environment variables in the replacement tokens into the launch format string.
509515
let mut base_replaced = false;
510-
let mut launch_command_str = launch_fmt.to_string();
511516
while let Some(start) = launch_command_str.find(REPLACEMENT_TOKEN_LEFT) {
512517
if let Some(end) = launch_command_str[start..].find(REPLACEMENT_TOKEN_RIGHT) {
513518
let replacement_identifier =

0 commit comments

Comments
 (0)