From c2b3209b20ad48a5503964136f6d15030463ccbf Mon Sep 17 00:00:00 2001 From: maximsmol <1472826+maximsmol@users.noreply.github.com> Date: Sun, 5 Apr 2026 09:52:55 -0700 Subject: [PATCH 1/2] allow force-quit if a transaction is running Signed-off-by: maximsmol <1472826+maximsmol@users.noreply.github.com> --- pgcli/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pgcli/main.py b/pgcli/main.py index 9ce15135d..713246185 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -926,7 +926,7 @@ def _check_ongoing_transaction_and_allow_quitting(self): while 1: try: choice = click.prompt( - "A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit.", + "A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit, `force` to exit anyway.", default="a", ) except click.Abort: @@ -938,6 +938,8 @@ def _check_ongoing_transaction_and_allow_quitting(self): choice = choice.lower() if choice == "a": return False # do not quit + if choice == "force": + return True # quit anyway if choice == "c": query = self.execute_command("commit") return query.successful # quit only if query is successful From a19b73c79d195b347a336fdd35f43938d9fc6edc Mon Sep 17 00:00:00 2001 From: maximsmol <1472826+maximsmol@users.noreply.github.com> Date: Sun, 5 Apr 2026 09:59:27 -0700 Subject: [PATCH 2/2] update changelog Signed-off-by: maximsmol <1472826+maximsmol@users.noreply.github.com> --- changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.rst b/changelog.rst index da6c611f1..531844374 100644 --- a/changelog.rst +++ b/changelog.rst @@ -7,6 +7,7 @@ Features: * Add cursor shape support for vi mode. When ``vi = True``, the terminal cursor now reflects the current editing mode: beam in INSERT, block in NORMAL, underline in REPLACE. Uses prompt_toolkit's ``ModalCursorShapeConfig``. +* Add the option to force-quit pgcli when a transaction is in progress. 4.4.0 (2025-12-24) ==================