diff --git a/src/classes/terminal.class.js b/src/classes/terminal.class.js index 7cd828d3e5f44d6369d0b22d5d971ebd2b4a7f23..7ec5bb658b65a85e13b6f7b41bed84e7618f4a49 100644 --- a/src/classes/terminal.class.js +++ b/src/classes/terminal.class.js @@ -147,7 +147,11 @@ class Terminal { }); break; case "Darwin": - require("child_process").exec(`lsof -a -d cwd -p ${pid} | tail -1 | awk '{print $9}'`, (e, cwd) => { + // OK, the following is quite of a hacky solution + // Each $XX after the $9 in the awk commands provide support for one more space + // character in the path (otherwise it just gets cut) + // There's probably a better way to do this, PRs welcome + require("child_process").exec(`lsof -a -d cwd -p ${pid} | tail -1 | awk '{print $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20}'`, (e, cwd) => { if (e !== null) { reject(e); } else {