diff --git a/changelog.rst b/changelog.rst index fdfcde538..da6c611f1 100644 --- a/changelog.rst +++ b/changelog.rst @@ -4,6 +4,9 @@ Upcoming (TBD) Features: --------- * Add support for `\\T` prompt escape sequence to display transaction status (similar to psql's `%x`). +* 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``. 4.4.0 (2025-12-24) ================== diff --git a/pgcli/main.py b/pgcli/main.py index 913228b33..9ce15135d 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -48,6 +48,7 @@ ) from prompt_toolkit.history import FileHistory from prompt_toolkit.auto_suggest import AutoSuggestFromHistory +from prompt_toolkit.cursor_shapes import ModalCursorShapeConfig from pygments.lexers.sql import PostgresLexer from pgspecial.main import PGSpecial, NO_QUERY, PAGER_OFF, PAGER_LONG_OUTPUT @@ -1087,6 +1088,7 @@ def get_continuation(width, line_number, is_soft_wrap): enable_suspend=True, editing_mode=EditingMode.VI if self.vi_mode else EditingMode.EMACS, search_ignore_case=True, + cursor=ModalCursorShapeConfig(), ) return prompt_app