Skip to content

Commit 5368805

Browse files
committed
feat: explain the SSH blocks now that we own the included file
Point users at "coder.sshConfig" from the block they are told not to edit, and say what the include is for in the file they own.
1 parent ac709bd commit 5368805

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/remote/sshConfig.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ export class SshConfig {
259259
}
260260
const include = [
261261
INCLUDE_START,
262-
"# Keep this first: SSH uses the first value it obtains for each option.",
262+
"# Your Coder workspaces live in the included file, which is managed",
263+
"# by the Coder VS Code extension. SSH uses the first value it obtains",
264+
"# for each option, so anything above this block overrides them.",
263265
`Include ${includePath}`,
264266
INCLUDE_END,
265267
].join("\n");
@@ -341,8 +343,8 @@ export class SshConfig {
341343
const { Host, ...otherValues } = values;
342344
const lines = [
343345
this.startBlockComment(safeHostname),
344-
"# This section is managed by the Coder VS Code extension.",
345-
"# Changes will be overwritten on the next workspace connection.",
346+
"# Rewritten by the Coder VS Code extension on every connection.",
347+
'# To change these options, use the "coder.sshConfig" setting instead.',
346348
`Host ${Host}`,
347349
];
348350

test/unit/remote/sshConfig.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { createMockLogger } from "../../mocks/testHelpers";
1616
const sshFilePath = "/Path/To/UserHomeDir/.sshConfigDir/sshConfigFile";
1717
const sshTempFilePrefix =
1818
"/Path/To/UserHomeDir/.sshConfigDir/.sshConfigFile.vscode-coder-tmp-";
19-
const managedHeader = `# This section is managed by the Coder VS Code extension.
20-
# Changes will be overwritten on the next workspace connection.`;
19+
const managedHeader = `# Rewritten by the Coder VS Code extension on every connection.
20+
# To change these options, use the "coder.sshConfig" setting instead.`;
2121

2222
const mockFileSystem = {
2323
mkdir: vi.fn(),
@@ -861,7 +861,9 @@ Host work-server
861861

862862
describe("updateInclude", () => {
863863
const include = `# --- START CODER VSCODE INCLUDE ---
864-
# Keep this first: SSH uses the first value it obtains for each option.
864+
# Your Coder workspaces live in the included file, which is managed
865+
# by the Coder VS Code extension. SSH uses the first value it obtains
866+
# for each option, so anything above this block overrides them.
865867
Include ~/.ssh/coder/config
866868
# --- END CODER VSCODE INCLUDE ---`;
867869

0 commit comments

Comments
 (0)