Skip to content

[Bug]: SSH suggestions show the wrong destination for Unicode aliases after question-mark rules #38183

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Not sure

Steps to reproduce

  1. Quit the T3 Code desktop app if it is open.
  2. In the home directory SSH config that this account's desktop app reads, save only two Host blocks, in this order. The first Host name is svc?x and its HostName is wrong.example.com. The second Host name is svcøx, with ø the single letter o with a stroke, and its HostName is byte-correct.example.com.
  3. In that account's SSH known hosts file, save only one line whose first field is byte-correct.example.com, followed by a key type and a key.
  4. Start the T3 Code desktop app built from this commit.
  5. Open Settings from the sidebar, then open Environments.
  6. Click Add environment.
  7. Click SSH.
  8. Click the SSH host or alias field, without typing, and read the suggestion list.

Expected behavior

The svcøx suggestion shows byte-correct.example.com beside it, and byte-correct.example.com is not listed again as its own suggestion.

Actual behavior

The svcøx suggestion shows wrong.example.com beside it, and byte-correct.example.com is listed as its own suggestion.

Impact

Minor bug or occasional failure. Users with a multibyte Unicode alias following an overlapping question-mark Host rule see misleading destination information whenever they browse SSH suggestions.

Version or commit

main at e9b48b7809. The cause is at packages/ssh/src/config.ts:168.

Environment

Linux x64, the repository's own tests.

Logs or stack traces

'svcøx', 'wrong.example.com', 'ssh-config'
Automated repro

Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.

diff --git a/packages/ssh/src/config.test.ts b/packages/ssh/src/config.test.ts
index a38e08edbf..810cd9945d 100644
--- a/packages/ssh/src/config.test.ts
+++ b/packages/ssh/src/config.test.ts
@@ -90,7 +90,7 @@ describe("ssh config", () => {
       yield* fs.makeDirectory(path.join(sshDir, "single.d"));
       yield* fs.writeFileString(
         path.join(sshDir, "config"),
-        "Include config.d/*\nInclude config.d/.literal.conf\nInclude config.d/.enabled-*.conf\nInclude explicit-directory\nInclude single.d/team?one.conf\nInclude single.d/exact??.conf\nHost real\n  HostName real.example.com\nHost svc?x\n  HostName wrong.example.com\nHost svc\u2028x\n  HostName correct.example.com\n",
+        "Include config.d/*\nInclude config.d/.literal.conf\nInclude config.d/.enabled-*.conf\nInclude explicit-directory\nInclude single.d/team?one.conf\nInclude single.d/exact??.conf\nHost real\n  HostName real.example.com\nHost svc?x\n  HostName wrong.example.com\nHost svc\u2028x\n  HostName correct.example.com\nHost svcøx\n  HostName byte-correct.example.com\n",
       );
       for (const [index, separator] of ["\u2028", "\u2029"].entries()) {
         yield* fs.writeFileString(
@@ -131,7 +131,7 @@ describe("ssh config", () => {
       );
       yield* fs.writeFileString(
         path.join(sshDir, "known_hosts"),
-        "known.example.com ssh-ed25519 AAAA\n",
+        "known.example.com ssh-ed25519 AAAA\nbyte-correct.example.com ssh-ed25519 AAAA\n",
       );
 
       const hosts = yield* discoverSshHosts({ homeDir });
@@ -145,6 +145,7 @@ describe("ssh config", () => {
           ["real", "real.example.com", "ssh-config"],
           ["single-ascii", "single-ascii.example.com", "ssh-config"],
           ["svc\u2028x", "correct.example.com", "ssh-config"],
+          ["svcøx", "byte-correct.example.com", "ssh-config"],
           ["team", "team.example.com", "ssh-config"],
           ["unicode-0", "unicode-0.example.com", "ssh-config"],
           ["unicode-1", "unicode-1.example.com", "ssh-config"],
cd packages/ssh && pnpm exec vp test run --config ../../vite.config.ts --dir . src/config.test.ts -t 'skips directories'

Workaround

No response

Activity

  1. added
    vouch:trusted
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions