remote-nvim.nvim icon indicating copy to clipboard operation
remote-nvim.nvim copied to clipboard

add remote working dir to workspace configuration

Open pffmachado opened this issue 1 year ago • 4 comments

Hi,

First of all, thanks in putting effort on development such plugin. It could very well be a nice counterpart of VSCode Remote Development.

I'm being using it with the ssh provider and so far I'm not facing relevant issues. However one thing I'm missing is the "automatic" directory change once logined.

For that reason, it could be handy one could add the remote_working_dir to the workspace configuration, which is the intention of this PR.

I didn't spend to much time on grasp in detail the overall architecture, and I just added what I thought it could make sense. So, if the change is not compliant with your plans we can just abandon this.

pffmachado avatar Mar 24 '24 11:03 pffmachado

Thanks for raising this PR ❤️ Appreciate you spending your valuable time and efforts to contribute to this project!

This feature is definitely useful. Just to gather more context around this, what use cases would this be helpful with to you? I have a long standing PR to add support for devcontainers where starting directly from where the workspace gets added on the remote is more useful, but besides that I could not think of any use cases to get it done early. Let me know your thoughts, we can probably extract it from that PR and add this feature first instead.

amitds1997 avatar Mar 24 '24 16:03 amitds1997

I had a quick look on the devpod PR, and think that is fine when using devcointainers!

However, what I'm looking for is mainly intended for ssh providers where I specify the working dir on the remote server (instead of starting at ~/). Then I could simply add an additional property on the "workspace.json" and once "RemoteStart conn" it will jump right way for the predifined location.

Now.., I do know that you have added the remote_working_dir to the Provider, however I got confused because I'm not seeing a easy/flexible way to overwrite besides through WorkspaceConfig, that was the reason I added in such way...

Clearly, and after looking the devcontainer PR, it should be way to overwrite remote_working_dir from multiple privders... So this PR will break partially that one...

pffmachado avatar Mar 24 '24 17:03 pffmachado

Apologies, totally lost track of this PR. We can add the ability to specify the working directory for SSH providers as well using the same approach. I have been thinking a bit more about this and we could provide an easy way for users to edit these fields, post the connection is done. We can make it extensible to include support for working directories for SSH as well. I'll separate that piece of code from that PR and add it before merging that.

This would also help me in simplifying that big PR. Thanks for your patience.

amitds1997 avatar Apr 21 '24 13:04 amitds1997

Apologies, totally lost track of this PR. We can add the ability to specify the working directory for SSH providers as well using the same approach. I have been thinking a bit more about this and we could provide an easy way for users to edit these fields, post the connection is done. We can make it extensible to include support for working directories for SSH as well. I'll separate that piece of code from that PR and add it before merging that.

This would also help me in simplifying that big PR. Thanks for your patience.

No worries! Thanks for having a look! That would be awesome, so, the user would simply post specify the working dir !

If you'll create that change then we close this PR!

pffmachado avatar Apr 22 '24 14:04 pffmachado