From 71b4ef84a01c62ff2dd4bf1f1289451c1b8bb08d Mon Sep 17 00:00:00 2001 From: drlkf Date: Thu, 20 Apr 2023 20:45:13 +0200 Subject: [PATCH 1/2] fix(io): fix crash when EDITOR is a full command when using a command with options as EDITOR e.g. `emacsclient -nw`, the `editor` command will crash the program: ``` FileNotFoundError: [Errno 2] No such file or directory: 'emacsclient -nw' ``` using `shell=True` in `subprocess` and formatting a command string from our parameters fixes this --- src/utils/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/io.py b/src/utils/io.py index f2c961f..0d32577 100644 --- a/src/utils/io.py +++ b/src/utils/io.py @@ -100,7 +100,7 @@ def input_from_editor() -> str: tf.write(initial_message) tf.flush() - subprocess.call([editor, tf.name]) + subprocess.call(f"{editor} '{tf.name}'", shell=True) tf.seek(0) msg = tf.read().decode().strip() From 84f78874233528d338f411cc3265ac1f2059dc91 Mon Sep 17 00:00:00 2001 From: Jerry Yang Date: Fri, 21 Apr 2023 09:09:53 +0800 Subject: [PATCH 2/2] bump: version (0.1.11 -> 0.1.12) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c383458..2c1e302 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "chatgpt-cli-md" -version = "0.1.11" +version = "0.1.12" description = "A markdown-supported command-line interface tool that connects to ChatGPT using OpenAI's API key." readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.8"