Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit 29e43a0

Browse files
author
Git²
committed
Win32 fixes - #97
1 parent a8a5fae commit 29e43a0

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

src/_renderer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ window._loadTheme = (theme) => {
4343
document.querySelector("style.theming").remove();
4444
}
4545

46-
document.querySelector("head").innerHTML += `<style class="theming" id="theme_${theme}_css">
46+
document.querySelector("head").innerHTML += `<style class="theming">
4747
@font-face {
4848
font-family: "${theme.cssvars.font_main}";
49-
src: url("${path.join(fontsDir, theme.cssvars.font_main.toLowerCase().replace(/ /g, '_')+'.woff2')}") format("woff2");
49+
src: url("${path.join(fontsDir, theme.cssvars.font_main.toLowerCase().replace(/ /g, '_')+'.woff2').replace(/\\/g, '/')}") format("woff2");
5050
}
5151
@font-face {
5252
font-family: "${theme.cssvars.font_main_light}";
53-
src: url("${path.join(fontsDir, theme.cssvars.font_main_light.toLowerCase().replace(/ /g, '_')+'.woff2')}") format("woff2");
53+
src: url("${path.join(fontsDir, theme.cssvars.font_main_light.toLowerCase().replace(/ /g, '_')+'.woff2').replace(/\\/g, '/')}") format("woff2");
5454
}
5555
@font-face {
5656
font-family: "${theme.terminal.fontFamily}";
57-
src: url("${path.join(fontsDir, theme.terminal.fontFamily.toLowerCase().replace(/ /g, '_')+'.woff2')}") format("woff2");
57+
src: url("${path.join(fontsDir, theme.terminal.fontFamily.toLowerCase().replace(/ /g, '_')+'.woff2').replace(/\\/g, '/')}") format("woff2");
5858
}
5959
6060
:root {
@@ -260,7 +260,7 @@ initGreeter = () => {
260260
greeter.innerHTML += `Welcome back, <em>${userlist[0].user}</em>`;
261261
})
262262
.catch(() => {
263-
greeter.innerHTML += `We||//c0m€ _b@-K;; <em>##ERr0r</em>`;
263+
greeter.innerHTML += "Welcome back";
264264
})
265265
.then(() => {
266266
greeter.setAttribute("style", "opacity: 1;");

src/classes/filesystem.class.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class FilesystemDisplay {
8181
let tcwd = dir;
8282
fs.readdir(tcwd, (err, content) => {
8383
if (err !== null) {
84+
console.warn(err);
8485
this.setFailedState();
8586
} else {
8687
this.cwd = [];
@@ -208,10 +209,10 @@ class FilesystemDisplay {
208209
}
209210

210211
if (e.type === "up" && this._noTracking) {
211-
cmd = `window.fsDisp.readFS('${path.resolve(this.dirpath, '..')}')`;
212+
cmd = `window.fsDisp.readFS('${path.resolve(this.dirpath, '..').replace(/\\/g, '\\\\')}')`;
212213
}
213214
if ((e.type === "dir" || e.type.endsWith("Dir")) && this._noTracking) {
214-
cmd = `window.fsDisp.readFS('${path.resolve(this.dirpath, e.name)}')`;
215+
cmd = `window.fsDisp.readFS('${path.resolve(this.dirpath, e.name).replace(/\\/g, '\\\\')}')`;
215216
}
216217

217218
if (e.type === "edex-theme") {

src/classes/ramwatcher.class.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ class RAMwatcher {
3838
let available = data.used-data.active;
3939
let active = data.active;
4040

41-
if (free+available+active !== total) throw("RAM Watcher Error: Bad memory values");
41+
if (process.platform === "win32") available = data.available;
42+
43+
if (free+available+active !== total && process.platform !== "win32") throw("RAM Watcher Error: Bad memory values");
44+
if (free+data.used !== total && process.platform === "win32") console.warn("RAM Watcher Error: Bad memory values");
4245

4346
// Convert the data for the 1000-points grid
4447
active = Math.round((1000*active)/total);

src/classes/terminal.class.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ class Terminal {
9999
this.fit();
100100
setTimeout(() => {
101101
this.fit();
102+
if (process.platform === "win32") {
103+
// Force Powershell to print a prompt
104+
setTimeout(() => {
105+
this.write("n");
106+
this.write("\b");
107+
}, 1000);
108+
}
102109
}, 200);
103110
};
104111
this.socket.onerror = (e) => {throw e};

0 commit comments

Comments
 (0)