Skip to content

Commit 0463f8a

Browse files
committed
Fix command quoting
1 parent cc5d143 commit 0463f8a

File tree

4 files changed

+37
-8
lines changed

4 files changed

+37
-8
lines changed

README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
11
# Coder Remote
22

3-
The Coder Remote extension lets you operate Coder from the comfort of VS Code.
3+
[![Visual Studio Marketplace](https://vsmarketplacebadges.dev/version/coder.coder-remote.svg)](https://marketplace.visualstudio.com/items?itemName=coder.coder-remote)
4+
[!["Join us on
5+
Discord"](https://img.shields.io/badge/join-us%20on%20Discord-gray.svg?longCache=true&logo=discord&colorB=green)](https://coder.com/chat?utm_source=github.com/coder/coder&utm_medium=github&utm_campaign=readme.md)
6+
[![Twitter
7+
Follow](https://img.shields.io/twitter/follow/coderhq?label=%40coderhq&style=social)](https://twitter.com/coderhq)
8+
9+
The Coder Remote extension lets you open [Coder](https://github.com/coder/coder) workspaces in VS Code with a single click.
10+
11+
- Open workspaces from the dashboard in a single click.
12+
- Automatically start workspaces when opened.
13+
- No command-line or local dependencies required - just install VS Code!
14+
- Works in air-gapped or restricted networks. Just connect to your Coder deployment!
15+
16+
## Getting Started
17+
18+
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
19+
20+
```
21+
ext install coder.coder-remote
22+
```
23+
24+
Alternatively, manually install the VSIX from the [latest release](https://github.com/coder/vscode-coder/releases/latest).

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Open any workspace with a single click.",
66
"repository": "https://github.com/coder/vscode-coder",
77
"preview": true,
8-
"version": "0.0.5",
8+
"version": "0.0.6",
99
"engines": {
1010
"vscode": "^1.73.0"
1111
},

src/commands.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,14 @@ export class Commands {
165165
remoteAuthority: "coder",
166166
})
167167
if (opened.length > 1) {
168-
const items: vscode.QuickPickItem[] = opened.map((folder): vscode.QuickPickItem => {
169-
return {
170-
label: folder.folderUri.fsPath,
171-
}
172-
})
168+
const items: vscode.QuickPickItem[] = opened
169+
// Filter out `/` since that's added above.
170+
.filter((folder) => folder.folderUri.path !== "/")
171+
.map((folder): vscode.QuickPickItem => {
172+
return {
173+
label: folder.folderUri.fsPath,
174+
}
175+
})
173176
const item = await vscode.window.showQuickPick(items, {
174177
title: "Select a recently opened folder",
175178
})

src/remote.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,14 @@ export class Remote {
392392
}
393393

394394
parsedConfig.remove({ Host: computedHost.Host })
395+
const escape = (str: string): string => `"${str.replace(/"/g, '\\"')}"`
395396
parsedConfig.append({
396397
Host: `${Remote.Prefix}*`,
397-
ProxyCommand: `${binaryPath} vscodessh --network-info-dir ${this.storage.getNetworkInfoPath()} --session-token-file ${this.storage.getSessionTokenPath()} --url-file ${this.storage.getURLPath()} %h`,
398+
ProxyCommand: `${escape(binaryPath)} vscodessh --network-info-dir ${escape(
399+
this.storage.getNetworkInfoPath(),
400+
)} --session-token-file ${escape(this.storage.getSessionTokenPath())} --url-file ${escape(
401+
this.storage.getURLPath(),
402+
)} %h`,
398403
ConnectTimeout: "0",
399404
StrictHostKeyChecking: "no",
400405
UserKnownHostsFile: "/dev/null",

0 commit comments

Comments
 (0)