@zgeoff/atc 1.0.2 → 1.0.3
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/daemon/screen-model.ts +16 -1
package/package.json
CHANGED
|
@@ -98,7 +98,7 @@ export class ScreenModel {
|
|
|
98
98
|
await pending;
|
|
99
99
|
} while (pending !== this.flushed);
|
|
100
100
|
|
|
101
|
-
return RESET_INPUT_MODES + this.
|
|
101
|
+
return RESET_INPUT_MODES + this.renderVisibleScreen() + this.renderInputModes();
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
updateDims(cols: number, rows: number): void {
|
|
@@ -109,6 +109,21 @@ export class ScreenModel {
|
|
|
109
109
|
this.term.dispose();
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
// A session on the alternate screen serializes as the normal buffer, a
|
|
113
|
+
// buffer switch, then the alternate buffer. The switch clears nothing on a
|
|
114
|
+
// terminal already in alternate mode — and the client always is, since its
|
|
115
|
+
// chrome runs there — so the normal-buffer paint would linger under the
|
|
116
|
+
// alternate one, showing through every cell the serializer skips as blank.
|
|
117
|
+
// The replay therefore keeps only what the switch precedes: the content of
|
|
118
|
+
// the buffer the session is actually showing.
|
|
119
|
+
private renderVisibleScreen(): string {
|
|
120
|
+
const serialized = this.serializer.serialize();
|
|
121
|
+
const altSwitch = '\u001B[?1049h\u001B[H';
|
|
122
|
+
const switchAt = serialized.lastIndexOf(altSwitch);
|
|
123
|
+
|
|
124
|
+
return switchAt === -1 ? serialized : serialized.slice(switchAt + altSwitch.length);
|
|
125
|
+
}
|
|
126
|
+
|
|
112
127
|
private renderInputModes(): string {
|
|
113
128
|
let out = '';
|
|
114
129
|
|