@lethevimlet/sshift 1.4.4 → 1.4.6
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/webapp/js/app.js +18 -14
package/package.json
CHANGED
package/src/webapp/js/app.js
CHANGED
|
@@ -995,14 +995,17 @@ sendChunkedInput(sessionId, data, chunkSize = 2048) {
|
|
|
995
995
|
session.terminal.refresh(0, session.terminal.rows - 1);
|
|
996
996
|
}
|
|
997
997
|
|
|
998
|
-
|
|
999
|
-
//
|
|
1000
|
-
//
|
|
1001
|
-
//
|
|
1002
|
-
//
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
998
|
+
// Sub-pixel seam mitigation is handled by canvas/WebGL renderer +
|
|
999
|
+
// customGlyphs: true, which draws block/box characters as vector fills
|
|
1000
|
+
// that meet exactly. letterSpacing nudging doesn't work because xterm.js
|
|
1001
|
+
// only accepts integer letterSpacing values. Origin-snapping transforms
|
|
1002
|
+
// are also unnecessary because the canvas/WebGL renderer paints the cell
|
|
1003
|
+
// grid in its own coordinate system. The remaining mitigation is:
|
|
1004
|
+
// - customGlyphs: true (set in Terminal options)
|
|
1005
|
+
// - canvas or WebGL renderer as default (not DOM)
|
|
1006
|
+
// - clearTextureAtlas() on DPR change (handled by _setupDPRListener)
|
|
1007
|
+
// - clean base metrics: letterSpacing: 0, lineHeight: 1.0 in _fitTerminal
|
|
1008
|
+
_snapCellWidth() { /* no-op: see comment above */ }
|
|
1006
1009
|
|
|
1007
1010
|
// Initialize (or re-initialize) the WebGL renderer addon for a session.
|
|
1008
1011
|
// Handles context-loss tracking with a retry cap: after 3 losses the session
|
|
@@ -1212,6 +1215,13 @@ sendChunkedInput(sessionId, data, chunkSize = 2048) {
|
|
|
1212
1215
|
return false;
|
|
1213
1216
|
}
|
|
1214
1217
|
|
|
1218
|
+
// Reset letterSpacing and lineHeight to base values before fitting so
|
|
1219
|
+
// alignToDeviceGrid measures from clean metrics rather than accumulated
|
|
1220
|
+
// nudges from a previous invocation.
|
|
1221
|
+
const term = session.terminal;
|
|
1222
|
+
term.options.letterSpacing = 0;
|
|
1223
|
+
term.options.lineHeight = 1;
|
|
1224
|
+
|
|
1215
1225
|
void container.offsetHeight;
|
|
1216
1226
|
void wrapper.offsetHeight;
|
|
1217
1227
|
|
|
@@ -1239,12 +1249,6 @@ sendChunkedInput(sessionId, data, chunkSize = 2048) {
|
|
|
1239
1249
|
}
|
|
1240
1250
|
}
|
|
1241
1251
|
|
|
1242
|
-
// NOTE: subpixel seam mitigation is handled by customGlyphs: true in
|
|
1243
|
-
// the Terminal options and by the DPR listener in _setupDPRListener.
|
|
1244
|
-
// letterSpacing snapping was tried but produced visible gaps between
|
|
1245
|
-
// all characters without reliably fixing block-character seams, so it
|
|
1246
|
-
// is disabled for now.
|
|
1247
|
-
|
|
1248
1252
|
console.log('[SSHIFT] Terminal fitted, cols:', terminal.cols, 'rows:', terminal.rows);
|
|
1249
1253
|
|
|
1250
1254
|
// Resize changes cell metrics; clear the WebGL atlas so glyphs are
|