We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c835d7 commit b956d32Copy full SHA for b956d32
src/include/filesystem.js
@@ -3,6 +3,7 @@ const fs = require('fs');
3
const path = require('path');
4
const open = require('open');
5
const find = require('find-in-files');
6
+const child_process = require('child_process');
7
8
class filesystem {
9
static find(pattern, dir) {
@@ -22,7 +23,14 @@ class filesystem {
22
23
}
24
25
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
+ }
34
35
36
static join(...args) {
@@ -38,4 +46,4 @@ class filesystem {
38
46
39
47
40
48
41
-module.exports = filesystem;
49
+module.exports = filesystem;
0 commit comments