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:
@@ -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