mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-12 22:47:08 +02:00
fix(single-instance): forward non-Unicode arguments and cwd (#3644)
* Update windows.rs * Create single-instance-non-unicode-args.md * fix on linux and windows too --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
1 parent
677258138b
commit
323fe80df1
5 files changed
+24
-11
No files matched your search
@@ -86,9 +86,12 @@ pub fn init<R: Runtime>(callback: Box<SingleInstanceCallback<R>>) -> TauriPlugin
|
||||
}
|
||||
|
||||
let cwd = std::env::current_dir().unwrap_or_default();
|
||||
let cwd = cwd.to_str().unwrap_or_default();
|
||||
let cwd = cwd.to_string_lossy();
|
||||
|
||||
let args = std::env::args().collect::<Vec<String>>().join("|");
|
||||
let args = std::env::args_os()
|
||||
.map(|arg| arg.to_string_lossy().into_owned())
|
||||
.collect::<Vec<String>>()
|
||||
.join("|");
|
||||
|
||||
let data = format!("{cwd}|{args}\0",);
|
||||
|
||||
|
||||
Reference in new issue
Block a user