未验证 提交 b0bc79d9 编写于 作者: G GitSquared

🏁 Fix switching drive commands on Windows

 #433
上级 d520f7e8
......@@ -278,8 +278,11 @@ class FilesystemDisplay {
} else if (e.type === "up") {
cmd = `window.term[window.currentTerm].writelr('cd ..')`;
} else if (e.type === "disk" || e.type === "rom" || e.type === "usb") {
let extraSwitch = (process.platform === "win32") ? " /D" : "";
cmd = `window.term[window.currentTerm].writelr('cd${extraSwitch} \\'${e.path.replace(/\\/g, "\\\\")}\\'')`;
if (process.platform === "win32") {
cmd = `window.term[window.currentTerm].writelr('${e.path.replace(/\\/g, "\\\\")}')`;
} else {
cmd = `window.term[window.currentTerm].writelr('cd \\'${e.path.replace(/\\/g, "\\\\")}\\'')`;
}
} else {
cmd = `window.term[window.currentTerm].write('\\'${e.name}\\'')`;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册