tabby-rdp 0.6.0-rc.3 → 0.6.0

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
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0
4
+
5
+ **Added**
6
+ - Choose IronRDP or the experimental FreeRDP client globally or for an individual RDP profile or configured desktop. IronRDP remains the default. FreeRDP supports display and input; clipboard, audio, shared folders, Hyper-V consoles and H.264 decoding remain unavailable in that client.
7
+ - Automatically hide the window's title/tab header for a single connected desktop, with optional minimum window dimensions. Never and Always modes are also available. Hover reveals the header without resizing the desktop.
8
+ - Default-off FreeRDP compatibility settings for glyph caching and relaxed drawing-order checks, with independent per-connection overrides. Glyph caching may help missing text on older servers or PAM login screens but can cause display artifacts. Individual PAM proxies remain unverified.
9
+ - Optional PDU traces alongside diagnostic logs, with a viewer for connection, resize and graphics timing. Traces record protocol structure and sizes, omitting credentials, keystrokes, clipboard contents and bitmap data.
10
+
11
+ **Fixed**
12
+ - Windows' default self-signed RDP certificates connect through IronRDP with forward-secret TLS 1.2 and ECDHE, while retaining certificate authority/fingerprint checks before sign-in ([#102](https://github.com/meanaverage/tabby-rdp/issues/102)). RSA key exchange is no longer offered; servers requiring it cannot connect. Logs show the negotiated TLS version and cipher. RD Gateway HTTPS may use TLS 1.3.
13
+ - Preserve the bitmap cache and Progressive tile state across Windows desktop resizes, preventing stale picture fragments, black bars and taskbar corruption ([#115](https://github.com/meanaverage/tabby-rdp/issues/115)).
14
+ - Tab-switch shortcuts no longer send their digit to the previously active remote desktop. macOS file pastes work when Electron omits native filesystem path resolution.
15
+ - Cancelling RD Gateway setup waits for its transport to close. FreeRDP also handles Unicode shortcuts, international keys, mouse-button chords, display-control resize and bounded input queues; it requires CredSSP version 5 or newer before authentication.
16
+ - Header auto-hide settles after resize reconnects, preserves native menu visibility and keeps revealed controls usable. Remote Desktop settings use Tabby's native toggle controls.
17
+
18
+ **Changed**
19
+ - Group settings by connection, display, keyboard, sound, sharing, SSH integration, compatibility and diagnostics, with everyday controls first.
20
+ - Run IronRDP connections through the bundled Go network helper on supported macOS, Windows and Linux architectures. Each desktop owns its helper and closes it when the connection ends.
21
+ - Install FreeRDP through optional platform-specific helper packages for macOS ARM64, Linux ARM64/x64 and Windows ARM64/x64. Intel Macs continue to use IronRDP. A synchronized global FreeRDP default falls back to IronRDP when the native helper is unavailable; an explicit per-connection choice reports the missing helper.
22
+ - Update the locked WinRM and QA download dependencies, and add scheduled dependency monitoring. These tools are excluded from plugin installations.
23
+
24
+ Requires Tabby 1.0.236 or later. Desktop qualification covers macOS, Linux and Windows ARM64 clients against Windows 11, Windows Server 2022/2025, GNOME and xrdp, plus the documented experimental KRDP setup. Additional Windows x64 direct and gateway checks passed. See the [compatibility guide](docs/compatibility.md) for client and server limitations.
25
+
26
+ ## 0.6.0-rc.5 (not published; included in 0.6.0)
27
+
28
+ **Added**
29
+ - Default-off experimental glyph caching for FreeRDP, with independent overrides in RDP profiles and configured desktops. It can help older RDP servers or PAM login screens with missing text; support for individual proxies still needs validation.
30
+
31
+ **Fixed**
32
+ - Cancelling RD Gateway setup closes its transport before returning, including when TLS shutdown and setup failure overlap.
33
+ - Pasting files copied on macOS works when Electron's filesystem wrapper omits native path resolution. Links inside a copied folder remain restricted to that folder.
34
+ - A Tabby shortcut that switches tabs no longer sends its key to the desktop being left while that desktop still has DOM focus.
35
+ - Windows' default self-signed RDP certificate now connects with forward-secret TLS in IronRDP ([#102](https://github.com/meanaverage/tabby-rdp/issues/102)). The RDP connection runs in the plugin's Go network helper, which accepts that certificate's key usage while still checking its fingerprint or authority before sign-in. RDP uses TLS 1.2 with ECDHE; RD Gateway HTTPS may use TLS 1.3. RSA key exchange is no longer offered, so a server that only offers it cannot connect. The negotiated version and cipher are shown in the connection log.
36
+
37
+ **Changed**
38
+ - Group Remote Desktop settings by connection, display, keyboard, sharing, SSH integration, compatibility and diagnostics. FreeRDP compatibility controls follow the everyday settings.
39
+ - The plugin package includes the network helper for supported macOS, Windows and Linux architectures. Tabby starts one per open IronRDP desktop and stops it when the desktop closes. FreeRDP remains an optional, experimental client with its own helper package.
40
+
41
+ ## 0.6.0-rc.4
42
+
43
+ **Added**
44
+ - A default-off **Relax drawing order checks** option for FreeRDP, with overrides in RDP profiles and configured
45
+ desktops. It accepts drawing orders a server or PAM proxy did not announce, which may help diagnose black screens.
46
+ The option applies on reconnect and does not change IronRDP.
47
+
3
48
  ## 0.6.0-rc.3
4
49
 
5
50
  **Added**
@@ -68,6 +68,12 @@ In an SSH tab (or a split pane) where you typed `ssh` on to another machine, **D
68
68
 
69
69
  GNOME Remote Desktop's headless mode gives each connection a screen of its own: a second computer, or another Tabby window, connected to the same account gets an empty extra screen rather than the same one. So when the desktop is open somewhere else already, you choose. **Take it over** disconnects the other connection, as Windows does; the session and its apps carry on, on this screen. **Open a second screen** keeps both, each with a screen of its own. A desktop taken over from here doesn't take itself back: it says so, and offers the same two choices.
70
70
 
71
+ <a id="helper"></a>
72
+
73
+ ## "The network helper …" in a desktop's error
74
+
75
+ From 0.6.0, connections run in a small program of the plugin's own, `tabby-rdp-proxy` (in the plugin's folder, under `bin/`), which Tabby starts for each open desktop and stops with it. It needs no installation of its own: it comes in the package, for macOS, Windows and Linux on x64 and ARM. "No network helper for …" means the package lacks this computer's (a system or processor it doesn't ship for, or a copy that lost it): reinstall the plugin. "Stopped unexpectedly" names how it ended and its last words, in the desktop's log; the desktop's next try starts a new one. Security software that blocks programs it doesn't know can stop it starting, or close its connections: allow `tabby-rdp-proxy` from Tabby's plugins folder. It listens on 127.0.0.1 only, for the desktop's own client, and connects to the desktops and gateways you open (through SSH, its bytes go through Tabby's own connection instead).
76
+
71
77
  <a id="recovery"></a>
72
78
 
73
79
  ## Recover a version, disable the plugin, or remove it
package/bin/SHA256SUMS ADDED
@@ -0,0 +1,8 @@
1
+ # The network helpers, built from helper/ with go1.27.1 by scripts/build-helper.mjs (tabby-rdp 0.6.0).
2
+ 3c83d313fd03bef1f6f02e60623174e9d27ac33e02fad3d0af6a0573f0146c25 bin/darwin-arm64/tabby-rdp-proxy
3
+ 753114f5c52de09178ee00b198d3650dd2a5db6f82507e0d7bfd1494f740e058 bin/darwin-x64/tabby-rdp-proxy
4
+ 9ac1faab4d966a419a9f4a08aa37bdee5c49818fc6c711021fc7277d4f02f267 bin/linux-x64/tabby-rdp-proxy
5
+ 65501571ef8d617201d95a2020bca72d67c92cb5abbd496869a241f67bd92412 bin/linux-arm64/tabby-rdp-proxy
6
+ 578773a71740c8ce7b8bfcfc9f78cdddf9d4fe29691d4bb06bccde8618f45f1a bin/linux-arm/tabby-rdp-proxy
7
+ 000d6e32822411284de03ab6d8bf3c8fe759d1443d1eddf76af16feb4cb0c2f2 bin/win32-x64/tabby-rdp-proxy.exe
8
+ add72fb59ac12d5896a1e2260ed0a186e6c34024ae753fdcccab4492c0293ff5 bin/win32-arm64/tabby-rdp-proxy.exe
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -4,6 +4,9 @@ exports.certificateAuthorities = certificateAuthorities;
4
4
  exports.chainStanding = chainStanding;
5
5
  exports.whyNotValid = whyNotValid;
6
6
  exports.certificateDetails = certificateDetails;
7
+ exports.authoritiesPem = authoritiesPem;
8
+ exports.peerCertificate = peerCertificate;
9
+ exports.validity = validity;
7
10
  exports.describeCertificate = describeCertificate;
8
11
  exports.vouched = vouched;
9
12
  /**
@@ -298,6 +301,91 @@ function certificateDetails(certificate, checked) {
298
301
  ...chain === 'authority' && !READ_REASONS.has(checked?.reason ?? '') ? { unchecked: true } : {},
299
302
  };
300
303
  }
304
+ /** A `ca` list (PEM, as TLS options take it), or Node's own list without one, as the PEM text of all of it. */
305
+ function authoritiesPem(authorities) {
306
+ return [authorities ?? certificateAuthorities() ?? tls.rootCertificates].flat().map(item => String(item)).join('\n');
307
+ }
308
+ /** The certificates of a `ca` list, parsed, by the list they were read from. */
309
+ const parsedByList = new WeakMap();
310
+ function parsedAuthorities(authorities) {
311
+ const cached = typeof authorities === 'object' && authorities ? parsedByList.get(authorities) : undefined;
312
+ if (cached) {
313
+ return cached;
314
+ }
315
+ const parsed = [];
316
+ for (const pem of authoritiesPem(authorities).matchAll(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)) {
317
+ try {
318
+ parsed.push(new crypto_1.X509Certificate(pem[0]));
319
+ }
320
+ catch { }
321
+ }
322
+ if (typeof authorities === 'object' && authorities) {
323
+ parsedByList.set(authorities, parsed);
324
+ }
325
+ return parsed;
326
+ }
327
+ /**
328
+ * A server's certificate as Node's TLS read it (TLSSocket.getPeerCertificate(true)), from the chain it sent (DER, its
329
+ * own certificate first) and the authorities its connection was checked against, now that the network helper does
330
+ * the TLS: each certificate's issuer is the next one the server sent that issued it, else one of the authorities that
331
+ * did (as OpenSSL takes a certificate for another's issuer: by name, key identifiers and key usage), up to one that is
332
+ * its own issuer, which is its own issuerCertificate, as Node has it. Undefined without a certificate it can read.
333
+ */
334
+ function peerCertificate(chain, authorities) {
335
+ const sent = [];
336
+ for (const der of chain) {
337
+ try {
338
+ sent.push(new crypto_1.X509Certificate(der));
339
+ }
340
+ catch {
341
+ if (!sent.length) {
342
+ return undefined;
343
+ }
344
+ }
345
+ }
346
+ if (!sent.length) {
347
+ return undefined;
348
+ }
349
+ const legacy = (c) => c.toLegacyObject();
350
+ const anchors = parsedAuthorities(authorities ?? certificateAuthorities() ?? tls.rootCertificates);
351
+ const leaf = legacy(sent[0]);
352
+ const used = new Set([sent[0]]);
353
+ let current = leaf;
354
+ let currentX = sent[0];
355
+ // A chain is a few certificates long; a server can send more, which go unused.
356
+ for (let depth = 0; depth < 16; depth++) {
357
+ if (currentX.checkIssued(currentX)) {
358
+ current.issuerCertificate = current;
359
+ break;
360
+ }
361
+ const next = sent.find(c => !used.has(c) && currentX.checkIssued(c)) ?? anchors.find(c => !used.has(c) && currentX.checkIssued(c));
362
+ if (!next) {
363
+ break;
364
+ }
365
+ used.add(next);
366
+ const issuer = legacy(next);
367
+ current.issuerCertificate = issuer;
368
+ current = issuer;
369
+ currentX = next;
370
+ }
371
+ return leaf;
372
+ }
373
+ /**
374
+ * Whether a certificate is valid for `name`, and why not: from the network helper's check of its chain against the
375
+ * authorities (`chainOk`, and OpenSSL's reason where it doesn't lead to one), then, as Node checks a name once the
376
+ * chain has passed, by Node's own rule for names (tls.checkServerIdentity). Without a name, never valid, and no reason
377
+ * (the desktops reached through an SSH host, whose names are that host's).
378
+ */
379
+ function validity(name, chainOk, reason, peer) {
380
+ if (!name) {
381
+ return { valid: false, reason: '' };
382
+ }
383
+ if (!chainOk || !peer) {
384
+ return { valid: false, reason: reason || 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' };
385
+ }
386
+ const wrong = tls.checkServerIdentity(name, peer);
387
+ return wrong ? { valid: false, reason: wrong.code ?? wrong.message } : { valid: true, reason: '' };
388
+ }
301
389
  /**
302
390
  * A certificate's details in a line: "Issued to <name> (<names>) by <issuer>, valid <from> to <to>." The server chose
303
391
  * all of it, so what could reorder or hide part of it shows as U+FFFD, and each part is cut short. `unchecked`: no
@@ -2392,6 +2392,8 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
2392
2392
  headerMinWidth: this.headerSize(store.headerMinWidth),
2393
2393
  headerMinHeight: this.headerSize(store.headerMinHeight),
2394
2394
  client: (0, rdpClient_1.rdpClient)(store.client),
2395
+ glyphCache: store.glyphCache === true,
2396
+ relaxOrderChecks: store.relaxOrderChecks === true,
2395
2397
  resize: ['live', 'reconnect', 'off'].includes(store.resize) ? store.resize : 'live',
2396
2398
  sharpness: store.sharpness === 'retina' ? 'retina' : 'standard',
2397
2399
  desk: store.desk === true,
@@ -3353,9 +3355,19 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
3353
3355
  }
3354
3356
  asked.gatewayAccount = signIn;
3355
3357
  }
3356
- // The proxy outlives an attempt: it reads the sign-in of the attempt it serves.
3358
+ // The proxy outlives an attempt: it reads the sign-in of the attempt it serves. One whose network helper
3359
+ // stopped (it failed, or was killed) is replaced: nothing connects there any more.
3360
+ if (session.proxy?.ended) {
3361
+ session.log.push('proxy: its network helper has stopped; starting another');
3362
+ session.proxy.close();
3363
+ session.proxy = null;
3364
+ }
3357
3365
  if (!session.proxy && client !== 'freerdp') {
3358
- const proxy = await (0, rdcleanpath_1.startRDCleanPathProxy)((_destination, signal) => gateway ? this.throughGateway(target, spec, session, gateway, endpoint, signal) : target.openTcp(asked.host, asked.port), (fingerprint, valid, reason, details) => this.checkCertificate(session, fingerprint, valid, reason, details), m => session.log.push(m), {
3366
+ const proxy = await (0, rdcleanpath_1.startRDCleanPathProxy)(
3367
+ // A desktop connected to directly is reached by the proxy's own connection; one behind an SSH host
3368
+ // through a channel of the SSH connection, carried to the proxy.
3369
+ async (_destination, signal) => gateway ? this.throughGateway(target, spec, session, gateway, endpoint, signal)
3370
+ : target.direct ? { direct: { host: asked.host, port: asked.port } } : target.openTcp(asked.host, asked.port), (fingerprint, valid, reason, details) => this.checkCertificate(session, fingerprint, valid, reason, details), m => session.log.push(m), {
3359
3371
  autologon: spec.kind === 'xrdp',
3360
3372
  withoutNla: () => this.checkWithoutNla(session),
3361
3373
  // Let through before TLS: the permission is held to the certificate the server then shows.
@@ -3475,8 +3487,9 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
3475
3487
  return entered && { ...signIn, credentials: entered, remember: !!signIn && entered.remember };
3476
3488
  }
3477
3489
  /**
3478
- * The proxy's stream to a desktop behind an RD Gateway (see gateway.ts): to the gateway as the SSH host (or this
3479
- * computer) reaches it, signed in with the gateway's own account or else the desktop's, then on to the desktop.
3490
+ * The proxy's way to a desktop behind an RD Gateway (see GatewayUpstream): to the gateway as the SSH host (or this
3491
+ * computer) reaches it, signed in with the gateway's own account or else the desktop's, then on to the desktop. The
3492
+ * account goes to the proxy only once the gateway's certificate is accepted.
3480
3493
  */
3481
3494
  async throughGateway(target, spec, session, gateway, endpoint, signal) {
3482
3495
  session.gatewayRefused = null;
@@ -3484,21 +3497,41 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
3484
3497
  if (spec.gatewayAccount && !own) {
3485
3498
  throw new Error('A separate gateway sign-in is required before connecting.');
3486
3499
  }
3500
+ if (signal?.aborted) {
3501
+ throw new Error('the desktop was closed meanwhile');
3502
+ }
3487
3503
  const credentials = own?.credentials ?? endpoint.credentials;
3488
3504
  session.log.push(`gateway: ${gateway.host}:${gateway.port}, signing in with ${own ? 'its separate account' : 'the desktop\'s sign-in'}`);
3505
+ return {
3506
+ gateway: { host: gateway.host, port: gateway.port },
3507
+ target: { host: endpoint.host, port: endpoint.port },
3508
+ via: target.direct ? { direct: { host: gateway.host, port: gateway.port } } : () => target.openTcp(gateway.host, gateway.port),
3509
+ clientName: os.hostname(),
3510
+ checkCertificate: (fingerprint, valid, reason, details) => this.checkGatewayCertificate(session, gateway, fingerprint, valid, reason, details),
3511
+ account: () => ({ username: credentials.username, password: credentials.password, domain: (own ? own.domain : endpoint.domain ?? spec.domain) || undefined }),
3512
+ // The gateway refused the account (its sign-in, or its connection authorization policy).
3513
+ refused: message => { session.gatewayRefused = message; },
3514
+ opened: () => {
3515
+ // Entered a moment ago and taken by the gateway: kept, while the account is still what it was signed in as.
3516
+ if (own?.remember && own.saveKey) {
3517
+ own.remember = false;
3518
+ const saveKey = own.saveKey;
3519
+ (0, signin_1.saveCredentialsIf)(saveKey, own.credentials, () => this.accountCurrent(saveKey, own.saveFor, own.accountRevision), own.saveLabel).then(saved => session.log.push(saved ? `gateway: saved as the account's password in ${(0, signin_1.storeName)()}` : 'gateway: not saved: the account changed meanwhile'), e => session.log.push(`gateway: ${(0, signin_1.storeName)()}: ${e?.message ?? e}`));
3520
+ }
3521
+ },
3522
+ };
3523
+ }
3524
+ /** FreeRDP still uses the plugin's stream-based gateway while IronRDP's helper owns its tunnel. */
3525
+ async throughGatewayStream(target, spec, session, gateway, endpoint, signal) {
3526
+ const route = await this.throughGateway(target, spec, session, gateway, endpoint, signal);
3489
3527
  try {
3490
- const stream = await (0, gateway_1.openThroughGateway)(() => target.openTcp(gateway.host, gateway.port), gateway, { username: credentials.username, password: credentials.password, domain: (own ? own.domain : endpoint.domain ?? spec.domain) || undefined }, { host: endpoint.host, port: endpoint.port }, (fingerprint, valid, reason, details) => this.checkGatewayCertificate(session, gateway, fingerprint, valid, reason, details), { log: m => session.log.push(m), clientName: os.hostname(), signal });
3491
- // Entered a moment ago and taken by the gateway: kept, while the account is still what it was signed in as.
3492
- if (own?.remember && own.saveKey) {
3493
- own.remember = false;
3494
- const saveKey = own.saveKey;
3495
- (0, signin_1.saveCredentialsIf)(saveKey, own.credentials, () => this.accountCurrent(saveKey, own.saveFor, own.accountRevision), own.saveLabel).then(saved => session.log.push(saved ? `gateway: saved as the account's password in ${(0, signin_1.storeName)()}` : 'gateway: not saved: the account changed meanwhile'), e => session.log.push(`gateway: ${(0, signin_1.storeName)()}: ${e?.message ?? e}`));
3496
- }
3528
+ const stream = await (0, gateway_1.openThroughGateway)(() => target.openTcp(gateway.host, gateway.port), gateway, await route.account(), route.target, route.checkCertificate, { log: m => session.log.push(m), clientName: route.clientName, signal });
3529
+ route.opened?.();
3497
3530
  return stream;
3498
3531
  }
3499
3532
  catch (e) {
3500
3533
  if (e instanceof gateway_1.GatewaySignInError) {
3501
- session.gatewayRefused = e.message;
3534
+ route.refused?.(e.message);
3502
3535
  }
3503
3536
  throw e;
3504
3537
  }
@@ -3998,6 +4031,10 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
3998
4031
  signal.addEventListener('abort', stop, { once: true });
3999
4032
  session.onConnectionEnd(stop);
4000
4033
  session.log.push(`client: ${rdpClient_1.RDP_CLIENT_LABELS.freerdp}`);
4034
+ const relaxOrderChecks = spec.relaxOrderChecks ?? this.settingsFor(session).relaxOrderChecks;
4035
+ const glyphCache = spec.glyphCache ?? settings.glyphCache;
4036
+ session.log.push(`FreeRDP glyph caching: ${glyphCache ? 'enabled (experimental)' : 'disabled'}`);
4037
+ session.log.push(`FreeRDP drawing order checks: ${relaxOrderChecks ? 'relaxed' : 'strict'}`);
4001
4038
  session.log.push('FreeRDP preview: clipboard, audio, microphone and shared folders are unavailable');
4002
4039
  session.clipboard = 'off';
4003
4040
  const [domain, username] = /^([^\\]+)\\(.+)$/.exec(endpoint.credentials.username)?.slice(1) ?? [endpoint.domain ?? spec.domain ?? '', endpoint.credentials.username];
@@ -4013,8 +4050,10 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
4013
4050
  // compares the two clients on the same path (test/suites/pdu-trace.ts).
4014
4051
  pipeline: spec.kind === 'gnome' || process.env.TRD_FREERDP_PIPELINE === '1',
4015
4052
  autologon: spec.kind === 'xrdp',
4053
+ relaxOrderChecks,
4054
+ glyphCache,
4016
4055
  open: async (abort) => {
4017
- const stream = gateway ? await this.throughGateway(target, spec, session, gateway, endpoint, abort) : await target.openTcp(endpoint.host, endpoint.port);
4056
+ const stream = gateway ? await this.throughGatewayStream(target, spec, session, gateway, endpoint, abort) : await target.openTcp(endpoint.host, endpoint.port);
4018
4057
  if (abort.aborted) {
4019
4058
  stream.destroy();
4020
4059
  throw new Error('Connection cancelled');
@@ -62,6 +62,17 @@ function askDesktop(pane, options) {
62
62
  <select class="form-control" name="gatewayAccount" title="A gateway that takes another account than the desktop: a saved account for it"></select>` + `
63
63
  <input class="form-control" name="wake" placeholder="Start it when off (optional): libvirt VM name, or MAC address" title="A libvirt VM on the host, started with virsh; or a MAC address to wake over the network from the host" spellcheck="false">
64
64
  <select class="form-control" name="clipboard" title="Which ways text, pictures and files copied on either side go between this computer and the desktop. Applies on the next connection"></select>
65
+ <h5>FreeRDP compatibility</h5>
66
+ <select class="form-control" name="glyphCache" aria-label="Glyph caching (FreeRDP)" title="Experimental glyph caching for older RDP servers or PAM login screens with missing text. May cause display artifacts; applies on reconnect.">
67
+ <option value="">Glyph caching: as in Settings</option>
68
+ <option value="on">Enable glyph caching (experimental)</option>
69
+ <option value="off">Disable glyph caching</option>
70
+ </select>` + `
71
+ <select class="form-control" name="relaxOrderChecks" aria-label="Relax drawing order checks (FreeRDP)" title="For a black screen or unannounced drawing order from a server or PAM proxy. Applies on the next FreeRDP connection.">
72
+ <option value="">Drawing order checks: as in Settings</option>
73
+ <option value="on">Relax drawing order checks (FreeRDP)</option>
74
+ <option value="off">Keep strict drawing order checks</option>
75
+ </select>` + `
65
76
  <div class="trd-signin-buttons">
66
77
  <button type="button" class="btn btn-secondary" name="cancel">Cancel</button>
67
78
  <button type="submit" class="btn btn-primary"></button>
@@ -87,6 +98,9 @@ function askDesktop(pane, options) {
87
98
  const client = field('client');
88
99
  client.append(new Option('RDP client: as in Settings', ''), ...Object.entries(rdpClient_1.RDP_CLIENT_LABELS).map(([id, label]) => new Option(label, id)));
89
100
  client.value = (0, rdpClient_1.ownRDPClient)(initial.client) ?? '';
101
+ for (const key of ['glyphCache', 'relaxOrderChecks']) {
102
+ field(key).value = initial[key] === true ? 'on' : initial[key] === false ? 'off' : '';
103
+ }
90
104
  // A VM saved from the host's list is xrdp on the host's word (see xrdpFromHost), which is a choice of its own here:
91
105
  // kept as long as it is chosen, so that the desktop still asks before signing in without NLA. Any kind picked is
92
106
  // the user's, xrdp included.
@@ -213,8 +227,12 @@ function askDesktop(pane, options) {
213
227
  gatewayAccount: gatewayText && gatewayAccount.value || undefined,
214
228
  clipboard: clipboard.value || undefined,
215
229
  client: (0, rdpClient_1.ownRDPClient)(client.value),
230
+ glyphCache: field('glyphCache').value === 'on' ? true
231
+ : field('glyphCache').value === 'off' ? false : undefined,
232
+ relaxOrderChecks: field('relaxOrderChecks').value === 'on' ? true
233
+ : field('relaxOrderChecks').value === 'off' ? false : undefined,
216
234
  };
217
- for (const key of ['username', 'domain', 'account', 'wake', 'gateway', 'gatewayAccount', 'clipboard', 'client']) {
235
+ for (const key of ['username', 'domain', 'account', 'wake', 'gateway', 'gatewayAccount', 'clipboard', 'client', 'glyphCache', 'relaxOrderChecks']) {
218
236
  if (entry[key] === undefined) {
219
237
  delete entry[key];
220
238
  }
package/dist/desktops.js CHANGED
@@ -60,7 +60,9 @@ function specOf(extra) {
60
60
  // Its own clipboard sharing, or none (the setting's).
61
61
  const clipboard = (0, clipboard_1.ownClipboard)(extra?.clipboard);
62
62
  const client = (0, rdpClient_1.ownRDPClient)(extra?.client);
63
- const own = { ...clipboard ? { clipboard } : {}, ...client ? { client } : {} };
63
+ const own = { ...clipboard ? { clipboard } : {}, ...client ? { client } : {},
64
+ ...typeof extra?.relaxOrderChecks === 'boolean' ? { relaxOrderChecks: extra.relaxOrderChecks } : {},
65
+ ...typeof extra?.glyphCache === 'boolean' ? { glyphCache: extra.glyphCache } : {} };
64
66
  const hyperv = (0, hyperv_1.vmId)(extra?.hyperv);
65
67
  if (hyperv) {
66
68
  return hyperVSpec(hyperv, configText(extra.name) || hyperv, {
@@ -246,10 +246,12 @@ function bounded(files) {
246
246
  * A path's real path, links all resolved, for the walk of copied folders. The system's own resolves a link that leads
247
247
  * through others (up to the 32 or 40 a system follows) several times quicker than Node's, which counts where a copied
248
248
  * folder is full of such links. Not on Windows, where it can name a folder otherwise than Node's (a mapped drive by its
249
- * share); the walk's paths must all be named one way.
249
+ * share); the walk's paths must all be named one way. Electron can wrap realpathSync without its native method;
250
+ * in that case Node's regular implementation still resolves links and preserves the copied-root boundary.
250
251
  */
251
252
  function realpath(file) {
252
- return process.platform === 'win32' ? fs.realpathSync(file) : fs.realpathSync.native(file);
253
+ const native = fs.realpathSync.native;
254
+ return process.platform !== 'win32' && typeof native === 'function' ? native(file) : fs.realpathSync(file);
253
255
  }
254
256
  /** Where a link leads, links all resolved; null if nowhere (it dangles, or goes round). */
255
257
  function resolved(file) {
package/dist/freerdp.js CHANGED
@@ -11,6 +11,7 @@ exports.hasFreeRDP = hasFreeRDP;
11
11
  exports.helperStopped = helperStopped;
12
12
  exports.ipcFrame = ipcFrame;
13
13
  exports.numbers = numbers;
14
+ exports.freeRDPStart = freeRDPStart;
14
15
  exports.freeRDPRelay = freeRDPRelay;
15
16
  exports.decodeNativeFrame = decodeNativeFrame;
16
17
  const child_process_1 = require("child_process");
@@ -117,6 +118,18 @@ function numbers(...values) {
117
118
  values.forEach((v, i) => out.writeUInt32BE(v >>> 0, i * 4));
118
119
  return out;
119
120
  }
121
+ /** The native helper's IPC 4 start message: six strings followed by seven uint32 fields. */
122
+ function freeRDPStart(options, relay) {
123
+ const strings = [options.host, options.username, options.password, options.domain, '', relay.token];
124
+ const fields = strings.map(value => {
125
+ if (value.includes('\0')) {
126
+ throw new Error('FreeRDP settings cannot contain a null character');
127
+ }
128
+ const text = Buffer.from(value);
129
+ return Buffer.concat([numbers(text.length), text]);
130
+ });
131
+ return Buffer.concat([...fields, numbers(relay.port, options.width, options.height, +options.pipeline, +!!options.autologon, +!!options.relaxOrderChecks, +!!options.glyphCache)]);
132
+ }
120
133
  /** Only a process holding the per-attempt token can open the SSH channel or gateway connection. */
121
134
  async function freeRDPRelay(open) {
122
135
  const token = (0, crypto_1.randomBytes)(32).toString('hex');
@@ -273,15 +286,7 @@ class FreeRDPProcess {
273
286
  }
274
287
  await new Promise((resolve, reject) => child.stdin.write(ipcFrame('A', authorities.subarray(at, at + 64 * 1024)), error => error ? reject(error) : resolve()));
275
288
  }
276
- const strings = [options.host, options.username, options.password, options.domain, '', this.relay.token];
277
- const fields = strings.map(value => {
278
- if (value.includes('\0')) {
279
- throw new Error('FreeRDP settings cannot contain a null character');
280
- }
281
- const text = Buffer.from(value);
282
- return Buffer.concat([numbers(text.length), text]);
283
- });
284
- this.send('S', Buffer.concat([...fields, numbers(this.relay.port, options.width, options.height, +options.pipeline, +!!options.autologon)]));
289
+ this.send('S', freeRDPStart(options, this.relay));
285
290
  }
286
291
  catch (error) {
287
292
  this.fail(error);
package/dist/keyboard.js CHANGED
@@ -121,7 +121,7 @@ let DesktopKeyboard = class DesktopKeyboard {
121
121
  if (!(0, rdpClient_1.isRDPElement)(focused)) {
122
122
  return;
123
123
  }
124
- if (!pane || !pane.element.nativeElement.contains(focused)) {
124
+ if (!pane || pane !== this.coveredPane() || !pane.element.nativeElement.contains(focused)) {
125
125
  // A desktop has the focus though its pane isn't the one the user is in (see
126
126
  // RemoteDesktopService.letGoUnlessInFront, which takes it back a moment after the pane is left): IronRDP,
127
127
  // whose listener comes after this one and only looks at the focus, would send it the key, view only or not.