@lethevimlet/sshift 1.4.2 → 1.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lethevimlet/sshift",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Web-based SSH + SFTP terminal client with tabs and bookmarks",
5
5
  "main": "src/server/index.js",
6
6
  "bin": {
@@ -1264,11 +1264,23 @@ sendChunkedInput(sessionId, data, chunkSize = 2048) {
1264
1264
  }
1265
1265
  }
1266
1266
 
1267
- console.log('[SSHIFT] Terminal fitted, cols:', terminal.cols, 'rows:', terminal.rows);
1268
-
1269
1267
  // Snap cell width to an integer number of device pixels so block/box
1270
1268
  // drawing characters tile without 1px seams on fractional-DPR displays.
1269
+ // This MUST be followed by a refit because letterSpacing changes the
1270
+ // cell width, which changes how many columns fit in the container.
1271
+ const letterSpacingBefore = terminal.options.letterSpacing || 0;
1271
1272
  this._snapCellWidth(session);
1273
+ const letterSpacingAfter = terminal.options.letterSpacing || 0;
1274
+
1275
+ // If letterSpacing changed, refit so xterm recalculates column count
1276
+ // with the new (snapped) cell width.
1277
+ if (letterSpacingAfter !== letterSpacingBefore) {
1278
+ try {
1279
+ session.fitAddon.fit();
1280
+ } catch (_) {}
1281
+ }
1282
+
1283
+ console.log('[SSHIFT] Terminal fitted, cols:', terminal.cols, 'rows:', terminal.rows);
1272
1284
 
1273
1285
  // Resize changes cell metrics; clear the WebGL atlas so glyphs are
1274
1286
  // re-rasterised at the new size rather than stretched from the old cache.