Skip to content

Commit 6fcc68b

Browse files
authored
show how to open files at terminal in code-server (#904)
1 parent e0499d3 commit 6fcc68b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

workspaces/editors.md

+33
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,39 @@ Web_ icon.
4141
> Code Web is Coder's open-source project
4242
> [code-server](https://coder.com/docs/code-server/latest).
4343
44+
### Opening files via the terminal
45+
46+
You can open files from your Coder workspace in VS Code via the terminal. We
47+
recommend creating an alias to the underlying code-server executable so that you
48+
can use the command `code` for this process:
49+
50+
```console
51+
alias code="/var/tmp/coder/code-server/bin/code-server -r"
52+
```
53+
54+
Then, to open a file (e.g., `personalize.log`):
55+
56+
```console
57+
code personalize.log
58+
```
59+
60+
Alternatively, if you would like to use just the code-server executable, add it
61+
to your `PATH`:
62+
63+
```console
64+
export PATH=$PATH:/var/tmp/coder/code-server/bin
65+
```
66+
67+
Then, to open a file (e.g., `personalize.log`):
68+
69+
```text
70+
code-server -r personalize.log
71+
```
72+
73+
> If you're using Coder's web terminal, make sure that you've opened a Code Web
74+
> session. If, however, you're using the web IDE's terminal, the file contents
75+
> will appear in the IDE.
76+
4477
## JetBrains Gateway with SSH
4578

4679
If your image

0 commit comments

Comments
 (0)