Skip to content
Merged
Changes from all commits
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
8 changes: 6 additions & 2 deletions packages/editor/src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class Editor {

// In case of using VSCode as an external editor,
// detect whether the MongoDB extension is installed and open a .mongodb file.
// If not open a .js file instead.
// If not open a .js file.
async _getExtension(cmd: string): Promise<string> {
if (!this._isVscodeApp(cmd)) {
return 'js';
Expand Down Expand Up @@ -170,7 +170,11 @@ export class Editor {
code
});

const proc = spawn(editor, [tmpDoc], { stdio: 'inherit' });
const proc = spawn(editor, [path.basename(tmpDoc)], {
stdio: 'inherit',
cwd: path.dirname(tmpDoc),
shell: true
});
// Pause the parent readable stream to stop emitting data events
// and get a child the total control over the input.
this._input.pause();
Expand Down