coder / sshcode

Run VS Code on any server over SSH.
MIT License
5.74k stars 215 forks source link

sshCmdStr should be updated #155

Closed Merith-TK closed 4 years ago

Merith-TK commented 5 years ago

as stated, this line https://github.com/cdr/sshcode/blob/master/sshcode.go#L147

    sshCmdStr :=
        fmt.Sprintf("ssh -tt -q -L %v:localhost:%v %v %v 'cd %v; %v --host 127.0.0.1 --auth none --port=%v'",
            o.bindAddr, o.remotePort, o.sshFlags, host, dir, codeServerPath, o.remotePort,
        )

should be

    sshCmdStr :=
        fmt.Sprintf("ssh -tt -q -L %v:localhost:%v %v %v '%v --host 127.0.0.1 --auth none --port=%v %v'",
            o.bindAddr, o.remotePort, o.sshFlags, host, codeServerPath, o.remotePort, dir,
        )

as code-server is no longer opening (atleast for me) in the users PWD when they call it

This edit tells code-server to open that path DIRECTLY from code-server same concept as upstream vscode

I have already implemented this in my fork (not yet pushed as i am still fixing it up)

deansheather commented 4 years ago

This patch doesn't work as you'd expect as code-server always opens the last opened dir before it tries to open whatever was passed on the command line. cdr/code-server#1132

Merith-TK commented 4 years ago

Okay this resolves it for code-server, but i was linked back here on sshcode, that resolves code-server, not sshcode.

Working on an idea to get 3.0.2 working on sshcode