Skip to content

show how to open files at terminal in code-server #904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions workspaces/editors.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,39 @@ Web_ icon.
> Code Web is Coder's open-source project
> [code-server](https://coder.com/docs/code-server/latest).

### Opening files via the terminal

You can open files from your Coder workspace in VS Code via the terminal. We
recommend creating an alias to the underlying code-server executable so that you
can use the command `code` for this process:

```console
alias code="/var/tmp/coder/code-server/bin/code-server -r"
```

Then, to open a file (e.g., `personalize.log`):

```console
code personalize.log
```

Alternatively, if you would like to use just the code-server executable, add it
to your `PATH`:

```console
export PATH=$PATH:/var/tmp/coder/code-server/bin
```

Then, to open a file (e.g., `personalize.log`):

```text
code-server -r personalize.log
```

> If you're using Coder's web terminal, make sure that you've opened a Code Web
> session. If, however, you're using the web IDE's terminal, the file contents
> will appear in the IDE.

## JetBrains Gateway with SSH

If your image
Expand Down