@oh-my-pi/pi-tui 13.6.0 → 13.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [13.6.2] - 2026-03-03
6
+ ### Fixed
7
+
8
+ - Fixed cursor positioning when content shrinks to empty without clearOnShrink enabled
9
+
5
10
  ## [13.5.4] - 2026-03-01
6
11
 
7
12
  ### Fixed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-tui",
4
- "version": "13.6.0",
4
+ "version": "13.6.2",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -33,8 +33,8 @@
33
33
  "test": "bun test test/*.test.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@oh-my-pi/pi-natives": "13.6.0",
37
- "@oh-my-pi/pi-utils": "13.6.0",
36
+ "@oh-my-pi/pi-natives": "13.6.2",
37
+ "@oh-my-pi/pi-utils": "13.6.2",
38
38
  "marked": "^17.0"
39
39
  },
40
40
  "devDependencies": {
package/src/tui.ts CHANGED
@@ -1113,15 +1113,17 @@ export class TUI extends Container {
1113
1113
  fullRender(true);
1114
1114
  return;
1115
1115
  }
1116
- if (extraLines > 0) {
1117
- buffer += "\x1b[1B";
1116
+ const clearStartOffset = newLines.length > 0 && extraLines > 0 ? 1 : 0;
1117
+ if (clearStartOffset > 0) {
1118
+ buffer += `\x1b[${clearStartOffset}B`;
1118
1119
  }
1119
1120
  for (let i = 0; i < extraLines; i++) {
1120
1121
  buffer += "\r\x1b[2K";
1121
1122
  if (i < extraLines - 1) buffer += "\x1b[1B";
1122
1123
  }
1123
- if (extraLines > 0) {
1124
- buffer += `\x1b[${extraLines}A`;
1124
+ const moveUp = extraLines - 1 + clearStartOffset;
1125
+ if (moveUp > 0) {
1126
+ buffer += `\x1b[${moveUp}A`;
1125
1127
  }
1126
1128
  buffer += "\x1b[?2026l";
1127
1129
  this.terminal.write(buffer);