Fixed an issue that was causing the edit command to close early when using terminal editors.