Add PI_NO_HARDWARE_CURSOR env var for terminals with limited escape sequence support
Fixes cursor visibility issues in JetBrains IDE terminals (IntelliJ, PyCharm) where the hardware cursor either blinks or becomes invisible depending on settings. Fixes #771
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- `PI_NO_HARDWARE_CURSOR=1` environment variable to disable hardware cursor positioning for terminals with limited escape sequence support (e.g., IntelliJ IDEA's built-in terminal)
|
||||
|
||||
## [0.47.0] - 2026-01-16
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
@@ -981,6 +981,12 @@ export class TUI extends Container {
|
||||
* @param totalLines Total number of rendered lines
|
||||
*/
|
||||
private positionHardwareCursor(cursorPos: { row: number; col: number } | null, totalLines: number): void {
|
||||
// PI_NO_HARDWARE_CURSOR=1 disables hardware cursor for terminals that don't handle it well
|
||||
if (process.env.PI_NO_HARDWARE_CURSOR === "1") {
|
||||
this.terminal.hideCursor();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cursorPos || totalLines <= 0) {
|
||||
this.terminal.hideCursor();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user