Skip to content
This repository has been archived by the owner on Jan 17, 2021. It is now read-only.

[MSYS BUG][Reason Discovered] ~ is resolved to msys home instead of remote home #180

Open
Merith-TK opened this issue May 11, 2020 · 1 comment

Comments

@Merith-TK
Copy link
Contributor

Merith-TK commented May 11, 2020

NOTICE: This first post is for when using sshcode user@server ~/X paths,

DISCLAIMER: This example was shown to affect both sshcode 10 builds and custom builds that use code-server 3.X

When you feed sshcode ~/ instead of "~/", it will attempt to use the local ~/ path.
for example if your user is merith and the remote user is developer
when you feed sshcode ~/Workspace it will attempt to open /home/merith/Workspace instead of /home/developer/Workspace

output from a shell giving this error

2020-05-11 12:26:24 ←[94mINFO←[0m       OS is windows, disabling connection reuse feature
2020-05-11 12:26:24 ←[94mINFO←[0m       ensuring code-server is updated...
++ uname -m
+ '[' x86_64 '!=' x86_64 ']'
+ pkill -f /home/developer/.sshcode-server
+ true
+ mkdir -p /home/developer/.sshcode-server
+ cd /home/developer/.sshcode-server
+ '[' '!' -d code-server-3.2.0-linux-x86_64 ']'
2020-05-11 12:26:27 ←[94mINFO←[0m       starting code-server...
2020-05-11 12:26:27 ←[94mINFO←[0m       Tunneling remote port 33885 to 127.0.0.1:24586
info  code-server 3.2.0 fd36a99a4c78669970ebc4eb05768293b657716f
info  HTTP server listening on http://127.0.0.1:33885
info    - No authentication
info    - Not serving HTTPS
info  Automatic updates are enabled
warn  ENOENT: no such file or directory, stat '/home/Merith/Workspace'
warn  ENOENT: no such file or directory, stat '/home/Merith/Workspace'

What fixes this.

These work

sshcode user@server "~/Workspace"
sshcode user@server \~/Workspace
sshcode user@server Workspace
sshcode user@server /opt/Workspace
sshcode user@server /home/user/Workspace

This dont work

sshcode user@server ~/Workspace

@Merith-TK Merith-TK changed the title [MSYS BUG] ~ is resolved to msys home [MSYS BUG][Reason Discovered] ~ is resolved to msys home instead of remote home May 11, 2020
@Merith-TK
Copy link
Contributor Author

Notice: this is for if gitbashWindowsDir() is not properly handling paths,

Still under investigation

$ go run ./ [email protected] --skipsync "~/Workspace"
2020-05-11 12:40:58 ←[94mINFO←[0m       OPENING:L659 ~C:/msys64/Workspace
2020-05-11 12:40:58 ←[94mINFO←[0m       OPENING:L677 ~C:/msys64/Workspace
2020-05-11 12:40:58 ←[94mINFO←[0m       OS is windows, disabling connection reuse feature
2020-05-11 12:40:58 ←[94mINFO←[0m       ensuring code-server is updated...
++ uname -m
+ '[' x86_64 '!=' x86_64 ']'
+ pkill -f /home/developer/.sshcode-server
+ true
+ mkdir -p /home/developer/.sshcode-server     
+ cd /home/developer/.sshcode-server
+ '[' '!' -d code-server-3.2.0-linux-x86_64 ']'
2020-05-11 12:41:03 ←[94mINFO←[0m       starting code-server...
2020-05-11 12:41:03 ←[94mINFO←[0m       Tunneling remote port 40727 to 127.0.0.1:35503
info  code-server 3.2.0 fd36a99a4c78669970ebc4eb05768293b657716f
info  HTTP server listening on http://127.0.0.1:40727
info    - No authentication
info    - Not serving HTTPS
info  Automatic updates are enabled
warn  ENOENT: no such file or directory, stat '/home/developer/~C:/msys64/Workspace'
warn  ENOENT: no such file or directory, stat '/home/developer/~C:/msys64/Workspace'

@Merith-TK Merith-TK reopened this May 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant