diff --git a/eris/__main__.py b/eris/__main__.py index 82a1ad9..a3fb517 100755 --- a/eris/__main__.py +++ b/eris/__main__.py @@ -791,7 +791,8 @@ class Screen: self._log.log_message([in_green("Editing "), path_colored, in_green(f" at line {line_num}…")]) subprocess.Popen(f"{self.editor_command} +{line_num} {path}", shell=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + start_new_session=True) def patch_file(self): result = self._summary.get_selection() if hasattr(result.tool, "patch_command") and result.tool.patch_command is not None: @@ -849,7 +850,8 @@ class Screen: path = self._summary.get_selection().path path_colored = lscolors.path_colored(path) self._log.log_message([in_green("Opening "), path_colored, in_green("…")]) - subprocess.Popen(["xdg-open", path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + subprocess.Popen(["xdg-open", path], stdout=subprocess.PIPE, stderr=subprocess.PIPE, + start_new_session=True) def save(self): worker.Worker.unsaved_jobs_total = 0 @@ -1077,6 +1079,8 @@ async def main(title, root_path, worker_count=None, editor_command=None, theme=N notifier.stop() if summary.is_loaded: screen.save() + if sys.stdout.isatty() and os.getpgrp() == os.getpid(): + os.killpg(os.getpgrp(), signal.SIGKILL) @contextlib.contextmanager