scripter-x 1.0.35 → 1.0.36
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/package.json +1 -1
- package/src/ui/fullscreen.js +7 -1
- package/src/update.js +12 -4
package/package.json
CHANGED
package/src/ui/fullscreen.js
CHANGED
|
@@ -37,6 +37,9 @@ export function FullScreen({ children }) {
|
|
|
37
37
|
// We register restore on exit + the kill signals so it runs no matter how we leave.
|
|
38
38
|
export function enterAltScreen() {
|
|
39
39
|
process.stdout.write('\x1b[?1049h'); // switch to alternate buffer
|
|
40
|
+
process.stdout.write('\x1b[r'); // reset scroll region to full screen (in case a prior
|
|
41
|
+
// session — e.g. an update-restart — left DECSTBM set,
|
|
42
|
+
// which would push our output to the bottom of the screen)
|
|
40
43
|
process.stdout.write('\x1b[2J\x1b[H'); // clear + home
|
|
41
44
|
process.stdout.write('\x1b[?25l'); // hide cursor (we draw our own ▏)
|
|
42
45
|
let restored = false;
|
|
@@ -44,7 +47,10 @@ export function enterAltScreen() {
|
|
|
44
47
|
if (restored) return;
|
|
45
48
|
restored = true;
|
|
46
49
|
try {
|
|
47
|
-
process.stdout.write('\x1b[?1000l\x1b[?1003l\x1b[?1006l'); // disable ALL mouse modes
|
|
50
|
+
process.stdout.write('\x1b[?1000l\x1b[?1003l\x1b[?1006l\x1b[?1015l'); // disable ALL mouse modes
|
|
51
|
+
process.stdout.write('\x1b[?2004l'); // disable bracketed-paste
|
|
52
|
+
process.stdout.write('\x1b[r'); // reset scroll region (so typed text isn't stuck at the bottom)
|
|
53
|
+
process.stdout.write('\x1b[?7h'); // restore line wrap
|
|
48
54
|
process.stdout.write('\x1b[?25h'); // show cursor
|
|
49
55
|
process.stdout.write('\x1b[?1049l'); // back to normal buffer (history intact)
|
|
50
56
|
} catch { /* */ }
|
package/src/update.js
CHANGED
|
@@ -95,10 +95,18 @@ function npmCliPath() {
|
|
|
95
95
|
function resetTerminal() {
|
|
96
96
|
try {
|
|
97
97
|
if (process.stdout.isTTY) {
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
process.stdout.write(
|
|
98
|
+
// Order matters. We must undo EVERY terminal mode the ink/fullscreen UI set, not just
|
|
99
|
+
// mouse + alt-screen — a leftover scroll region (DECSTBM) or bracketed-paste mode makes
|
|
100
|
+
// typed characters land at the bottom of the screen instead of at the prompt.
|
|
101
|
+
const w = (s) => process.stdout.write(s);
|
|
102
|
+
w('\x1b[?1000l\x1b[?1003l\x1b[?1006l\x1b[?1015l'); // disable ALL mouse modes
|
|
103
|
+
w('\x1b[?2004l'); // disable bracketed-paste mode
|
|
104
|
+
w('\x1b[r'); // reset scroll region (DECSTBM) to the full screen ← the bottom-text fix
|
|
105
|
+
w('\x1b[?7h'); // re-enable line wrap (autowrap)
|
|
106
|
+
w('\x1b[0m'); // reset SGR (colors/attrs)
|
|
107
|
+
w('\x1b[?1049l'); // leave alt-screen → normal buffer (history intact)
|
|
108
|
+
w('\x1b[?25h'); // show cursor
|
|
109
|
+
w('\x1b[!p'); // DECSTR: soft terminal reset (restores sane default modes)
|
|
102
110
|
}
|
|
103
111
|
} catch { /* */ }
|
|
104
112
|
try {
|