Skip to content

Commit 70f0ebf

Browse files
committed
Cherry-pick upstream dbcli#1558: cursor shape indicator for vi mode
1 parent b593ace commit 70f0ebf

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Features:
77
* Drop Python 3.9 support (EOL October 2025). Minimum version is now 3.10.
88
* Update CI: PostgreSQL 10 → 16, fix duplicate checkout step.
99
* Suppress timezone message in non-interactive mode (``-c``, ``-f``).
10+
* Add cursor shape support for vi mode: beam in INSERT, block in NORMAL,
11+
underline in REPLACE. Uses ``ModalCursorShapeConfig`` (upstream #1558).
1012

1113
Bug Fixes:
1214
----------

pgcli/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
)
4949
from prompt_toolkit.history import FileHistory
5050
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
51+
from prompt_toolkit.cursor_shapes import ModalCursorShapeConfig
5152
from pygments.lexers.sql import PostgresLexer
5253

5354
from pgspecial.main import PGSpecial, NO_QUERY, PAGER_OFF, PAGER_LONG_OUTPUT
@@ -1271,6 +1272,7 @@ def get_continuation(width, line_number, is_soft_wrap):
12711272
enable_suspend=True,
12721273
editing_mode=EditingMode.VI if self.vi_mode else EditingMode.EMACS,
12731274
search_ignore_case=True,
1275+
cursor=ModalCursorShapeConfig(),
12741276
)
12751277

12761278
return prompt_app

0 commit comments

Comments
 (0)