vscode-remote-release
vscode-remote-release copied to clipboard
Remote targets order is not determined by my ssh config
I place Host M on the top of my ssh config file, however, Host M is at the bottom of ssh remote target list:
After I change the name of Host M to 123 and click the flush button, it moves to the top:
And I change the name of Host 123 to 123123 and click the flush button, it moves to the bottom again:
Why my remote targets order is not determined by my ssh config? What is the reason for this situation? Refs: https://github.com/microsoft/vscode-remote-release/issues/4808
Thanks for filing. I'm unable to reproduce this on the latest VS Code Insiders and Remote-SSH pre-release extension. Are you on the latest versions of both?
My environment:
macOS: 12.7.2 Apple M1 Pro silicon
Version: 1.89.1 (Universal)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:14:24.611Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 21.6.0
Remote - SSH: v0.112.2024053015 (pre-release)
Remote Explorer: v0.5.2024052909 (pre-release)
I reproduce this on another intel macbook, and its information is as follows:
macOS: 12.7.2 Intel Core i7
Version: 1.89.1 (Universal)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:14:24.611Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin x64 21.6.0
Remote - SSH: v0.112.2024053015 (pre-release)
Remote Explorer: v0.5.2024052909 (pre-release)
I found that the hosts are arranged in the following patterns:
- Normal number
Host(e.g.123,22222etc.) is always ranked ahead of otherHost(e.g.M,1.2,02222etc.) - If there are multiple normal number
Host, they are arranged in order of size. For example, Host22226is always ranked ahead of Host123123, regardless of their order in~/.ssh/config. - If there are multiple other
Host, they are arranged according to the order in the~/.ssh/config.
@bamurtaugh Accroding to my info, can you repeat the patterns I mentioned above? Thanks for your work.
Hmm maybe this is macOS specific? I don't have a mac to test, perhaps @roblourens will have other insights / be able to repro.
Seems like this happens for just numeric Host names, and seems to be because we use Object.keys on an object which usually returns keys in insertion order but for numeric keys (even a string of numbers) those get sorted to the top