Skip to content

Commit

Permalink
Try to fix mac editors
Browse files Browse the repository at this point in the history
  • Loading branch information
crschnick committed Sep 16, 2023
1 parent 855969a commit 468d48f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ private void openFile(String file) {

try {
var command = SystemUtils.IS_OS_WINDOWS ?
List.of("cmd.exe", "/c", "start \"\" \"" + editor + "\" \"" + file + "\"") :
List.of("sh","-c", "\"" + editor + "\" \"" + file + "\"");
List.of("cmd.exe", "/c", "start \"\" \"" + editor + "\" \"" + file + "\"") : SystemUtils.IS_OS_LINUX ?
List.of("sh", "-c", "\"" + editor + "\" \"" + file + "\"") : List.of("open", "-a", editor, file);
logger.trace("Executing command: " + command);
Runtime.getRuntime().exec(command.toArray(String[]::new));
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ private static String getDefaultEditor() {
return "notepad";
}

if (SystemUtils.IS_OS_MAC) {
return "TextEdit.app";
}

return System.getenv("VISUAL") != null ?
System.getenv("VISUAL") : null;
}
Expand Down

0 comments on commit 468d48f

Please sign in to comment.