Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/include/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class filesystem {
static open(file) {
let editor = process.env.VISUAL;

if (editor || (editor = process.env.EDITOR)) {
return child_process.spawn(editor, [file], {
stdio: 'inherit'
});
} else {
return open(file);
if (!editor && !(editor = process.env.EDITOR)) {
editor = "vi";
}

return child_process.spawn(editor, [file], {
stdio: 'inherit'
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for your contribution. What you suggest would not work on Windows unfortunately. What do you think of bumping the open package from 0.0.5 to 7.0.4 and using:

Suggested change
if (!editor && !(editor = process.env.EDITOR)) {
editor = "vi";
}
return child_process.spawn(editor, [file], {
stdio: 'inherit'
});
if (editor || (editor = process.env.EDITOR)) {
return child_process.spawn(editor, [file], {
stdio: 'inherit'
});
} else {
return async () => await open(file);
}

}

static join(...args) {
Expand Down