1
>
/*---------------------------------------------------------------------------------------------
sshConfigParsing.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import type { ISSHResolvedConfig } from './sshRemoteAgentHost.js';
7
>
8
>
/** Strip inline comments from an SSH config value. */
9
>
export function stripSSHComment(s: string): string {
10
const idx = s.indexOf(' #');
11
return idx !== -1 ? s.substring(0, idx).trim() : s;
12
}
14
>
/**
15
>
* Extract Host aliases from SSH config content (without following Includes).
16
>
*/
17
>
export function parseSSHConfigHostEntries(content: string): string[] {
18
const hosts: string[] = [];
19
for (const line of content.split('\n')) {