Licence
MIT
Version
1.0.2
Deps
0
Size
6 kB
Vulns
0
Weekly
0
@joyanhui/pi-ext-bar-cursor
A pi extension that replaces the default block (reverse-video) cursor with a vertical bar using the terminal's native hardware cursor shape.
Features
- Vertical bar cursor — uses DECSCUSR (
\x1b[6 q) to tell the terminal to show a steady vertical bar - Block cursor removal — strips pi's fake block cursor (reverse-video
\x1b[7m) so the hardware bar cursor is visible - Zero text shift — cursor width is preserved exactly, no crashes or text movement
- IME compatible — preserves
CURSOR_MARKERfor IME candidate-window placement
Installation
pi install npm:@joyanhui/pi-ext-bar-cursor
Or for a single session:
pi -e npm:@joyanhui/pi-ext-bar-cursor
Requirements
- pi coding agent (v0.x+)
showHardwareCursor: truein pi'ssettings.json
Usage
Once installed, the extension activates automatically on every session start. No commands or shortcuts needed.
If you're not using a terminal emulator that supports DECSCUSR (the \x1b[6 q sequence), you may need to check your terminal's cursor shape support.
How it works
- On
session_start, sends\x1b[6 q(DECSCUSR) to set a steady vertical bar cursor - Overrides pi's editor component to strip the reverse-video block cursor from each rendered line
- The hardware bar cursor shows through unobstructed
Documentation
For more information, visit dev.leiyanhui.com/ai/pi-bar-cursor.
License
MIT