@joyanhui/pi-ext-bar-cursor
Pi coding agent extension — replaces the default block cursor with a vertical bar using the terminal's native hardware cursor shape (DECSCUSR)
Package details
Install @joyanhui/pi-ext-bar-cursor from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@joyanhui/pi-ext-bar-cursor- Package
@joyanhui/pi-ext-bar-cursor- Version
1.0.2- Published
- Jul 18, 2026
- Downloads
- 425/mo · 425/wk
- Author
- joyanhui
- License
- MIT
- Types
- extension
- Size
- 6.2 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./bar-cursor.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@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