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

Commit 3b8a381

Browse files
committed
Add VISUAL and EDITOR env check to open command
1 parent ee35f64 commit 3b8a381

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/include/filesystem.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ class filesystem {
2323
}
2424

2525
static open(file) {
26-
if ((process.env.SSH_CLIENT || process.env.SSH_TTY) && process.env.EDITOR) {
27-
var child = child_process.spawn(process.env.EDITOR, [file], {
28-
stdio: 'inherit'
29-
});
30-
return child;
31-
} else {
32-
return open(file);
33-
}
26+
let editor = process.env.VISUAL;
27+
28+
if (editor || (editor = process.env.EDITOR)) {
29+
return child_process.spawn(editor, [file], {
30+
stdio: 'inherit'
31+
});
32+
} else {
33+
return open(file);
34+
}
3435
}
3536

3637
static join(...args) {

0 commit comments

Comments
 (0)