-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Allow opening files, folders, and workspaces in existing code-server from CLI #1994
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
Conversation
I'm so sorry about this! Deleted the dev branch was gonna switch this back to base on master but GitHub doesn't let you do that.... After you delete the PR base. 🤦 Please open a new PR with these changes! Once again, I'm so sorry! |
Nvm, got it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it a test run and it works like a charm! Left a couple minor comments and am curious as to your thoughts on them.
Awesome. It looks like the patch needs to be regenerated (to update the line number and hash) and I recently made a change to |
Add initial support for opening files / folders in running code-server instance. Current limitations: - unable to open a file in a new window, only folders - unable to use addMode feature - others...
* Change loop to indexed `for` loop * Moved isDirectory check to IsDir local func, to prevent continue in loop and messy try/catch * Cleaned up white space issue with patch
Think I got it, let me know how the PR looks now |
Looks great! Thanks for the contribution. ❤️ |
I think we can actually remove the open-in flag, lemme know if you think there could be any problems with that: #2013 |
I'm getting this error:
Thoughts? |
@BEFH strange! Can you tell us more about your environment? |
Also, do you get that when running from within the integrated
terminal or is it from an external terminal?
|
@jsjoeio, what do you want to know about my environment? I can run commands and attach information. I have installed code-server using anaconda and use fish as my shell. The server is running within a job on a centos 7 cluster with a bsub/lsf scheduler. @code-asher, I am using the integrated terminal |
Huh, strange. VS Code is supposed to set the Can you verify that |
```
$ echo $VSCODE_IPC_HOOK_CLI
/hpc/users/fultob01/vsc_runtime/vscode-ipc-ce1bb1ea-f88b-449b-8fbc-5169544ff4d9.sock
$ code-server -r lsf.yaml
[2022-07-21T00:56:42.371Z] error got error from Code
{"error":{"errno":-2,"code":"ENOENT","syscall":"connect","address":"/hpc/users/fultob01/vsc_runtime/vscode-ipc-3d4badd4-9fa1-4f11-ab17-26ea33f5703f.sock"}}
```
I also ran the same command from the same node outside of vscode (after
setting the VSCODE_IPC_HOOK_CLI variable), and I got the same error.
|
Very strange that it is using the wrong path. The code seems to just use that as-is if it exists. Lines 747 to 750 in 40b650b
Could you run it with trace logging? |
Add initial support for opening files / folders in running code-server instance.
Capabilities:
$ code-server --reuse-window --open-in foo.txt # or $ code-server -oi foo.txt -r
$ code-server --new-window --open-in path/to/project # or $ code-server -oi path/to/project -n
Current limitations:
#164