From 6d3148f208262b25acb0c317181fb17e1a07c8d3 Mon Sep 17 00:00:00 2001 From: Mark Milligan Date: Wed, 16 Mar 2022 16:50:06 -0500 Subject: [PATCH 1/4] show how to open files at terminal in code-server --- workspaces/editors.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/workspaces/editors.md b/workspaces/editors.md index 716840c83..da5d537cb 100644 --- a/workspaces/editors.md +++ b/workspaces/editors.md @@ -41,6 +41,27 @@ Web_ icon. > Code Web is Coder's open-source project > [code-server](https://coder.com/docs/code-server/latest). +You can open files from your Coder workspace in VS Code in the browser aka Code Web using a terminal command. + +If you would like to use the familiar `code` command, create an alias to the code-server executable. + +```text +alias code="/var/tmp/coder/code-server/bin/code-server -r" +``` + +If you would like to just use the code-server executable, add it to your path, like in a .profile or .bashrc + +```text +export PATH=$PATH:/var/tmp/coder/code-server/bin +``` + +If you run the command in Web Terminal, a Code Web session must already be open. If you run the command in a Code Web terminal, the file contents will appear in the editor above. + +```text +code personalize.log +code-server personalize.log +``` + ## JetBrains Gateway with SSH If your image From 3b48c7413f5e827a194eaf1b8ee87b9e44a5a610 Mon Sep 17 00:00:00 2001 From: Katie Horne Date: Fri, 18 Mar 2022 09:52:36 -0500 Subject: [PATCH 2/4] Update workspaces/editors.md --- workspaces/editors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspaces/editors.md b/workspaces/editors.md index da5d537cb..059d0d251 100644 --- a/workspaces/editors.md +++ b/workspaces/editors.md @@ -59,7 +59,7 @@ If you run the command in Web Terminal, a Code Web session must already be open. ```text code personalize.log -code-server personalize.log +code-server -r personalize.log ``` ## JetBrains Gateway with SSH From bdead74dc6eea38cbd1f1fadd7b8c26862dc67d4 Mon Sep 17 00:00:00 2001 From: Katie Horne Date: Fri, 18 Mar 2022 10:08:59 -0500 Subject: [PATCH 3/4] chore: edit text --- workspaces/editors.md | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/workspaces/editors.md b/workspaces/editors.md index da5d537cb..c42c5827a 100644 --- a/workspaces/editors.md +++ b/workspaces/editors.md @@ -41,27 +41,38 @@ Web_ icon. > Code Web is Coder's open-source project > [code-server](https://coder.com/docs/code-server/latest). -You can open files from your Coder workspace in VS Code in the browser aka Code Web using a terminal command. +### Opening files via the terminal -If you would like to use the familiar `code` command, create an alias to the code-server executable. +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: -```text +```console alias code="/var/tmp/coder/code-server/bin/code-server -r" ``` -If you would like to just use the code-server executable, add it to your path, like in a .profile or .bashrc +Then to open a file (e.g., `personalize.log`): -```text +```console +code personalize.log +``` + +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 ``` -If you run the command in Web Terminal, a Code Web session must already be open. If you run the command in a Code Web terminal, the file contents will appear in the editor above. +Then to open a file (e.g., `personalize.log`): -```text -code personalize.log -code-server personalize.log +```console +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 From 507991de45ef449cb1ee8c4e3e98d29ba040fecd Mon Sep 17 00:00:00 2001 From: Katie Horne Date: Fri, 18 Mar 2022 10:14:41 -0500 Subject: [PATCH 4/4] chore: clarify instructions --- workspaces/editors.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/workspaces/editors.md b/workspaces/editors.md index 715f049dc..542d62f77 100644 --- a/workspaces/editors.md +++ b/workspaces/editors.md @@ -51,19 +51,20 @@ can use the command `code` for this process: alias code="/var/tmp/coder/code-server/bin/code-server -r" ``` -Then to open a file (e.g., `personalize.log`): +Then, to open a file (e.g., `personalize.log`): ```console code personalize.log ``` -If you would like to use just the code-server executable, add it to your `PATH`: +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`): +Then, to open a file (e.g., `personalize.log`): ```text code-server -r personalize.log