Skip to content
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

Add setting to specify commands to execute on connection #1139

Closed
ArcanoxDragon opened this issue Aug 11, 2019 · 3 comments
Closed

Add setting to specify commands to execute on connection #1139

ArcanoxDragon opened this issue Aug 11, 2019 · 3 comments
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH

Comments

@ArcanoxDragon
Copy link

So far I've very much been enjoying the Remote SSH extension, and have found it to be a huge productivity booster while working on remote servers...there's just one thing missing that would make it even better.

I discovered I can set my VISUAL variable to code -w so commands like crontab -e and visudo open the file being edited in an actual VSCode editor tab. This is extremely useful and I was pleasantly surprised when I tried it the first time and learned how well it works. However, it's a bit of a pain to have to manually set this every time I open the workspace. I can't put it in my .bash_profile because if I connect via another client, all of a sudden my editor doesn't work because it's trying to use code -w without being connected through VSCode.

I would like a way to specify, via VSCode settings, a list of remote commands to run after connecting to the remote host. This could be at the global, workspace, or "remote" level. This would allow me to put something like "remote.SSH.connectCommands": [ "export VISUAL=\"code -w\"" ] in my workspace settings and have it automatically set the variable only when connecting via VSCode. I couldn't find any other way of accomplishing this with the functionality included in "Remote: SSH" currently.

@egamma egamma added feature-request Request for new features or functionality ssh Issue in vscode-remote SSH labels Aug 13, 2019
@antst
Copy link

antst commented Feb 20, 2020

I also would love to have this functionality.
Typical case is that on remote system with Lmod (or environmental modules) there are some modules needs to be loaded for particular workspace (for example to get environment for compiler etc), and it would be very nice to have option to configure commands to execute on connect, to automatically do it.

@giddyhup
Copy link

You might find a solution here: #1722 (comment) (using the terminal.integrated.shellArgs.linux setting).

@tanhakabir
Copy link

Thank you for this request! I see on #4474 others have requested something similar. I'm going to close this issue and track progress on this feature on #4474.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

5 participants