From b0bc79d93635bbc29752b55e4ffd745827f8d816 Mon Sep 17 00:00:00 2001 From: GitSquared Date: Tue, 19 Feb 2019 19:20:32 +0100 Subject: [PATCH] :checkered_flag: Fix switching drive commands on Windows #433 --- src/classes/filesystem.class.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/classes/filesystem.class.js b/src/classes/filesystem.class.js index 454e6c7d..72f2ae3f 100644 --- a/src/classes/filesystem.class.js +++ b/src/classes/filesystem.class.js @@ -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}\\'')`; }