- Notifications
You must be signed in to change notification settings - Fork928
Closed
Labels
Description
Since we are starting the coder agent in the tmpdir, SFTP sessions also start in that folder.
Arguably, the session should start in$HOME
because this is my experience with OpenSSH and it's more useful when doingsftp
followed byls
(list files) or doing something with home-relative paths.
sftp coder.work.mainConnected to coder.work.main.sftp> pwdRemote working directory: /tmp/coder.KnYnxH
There are (potentially) two ways to fix this:
- Run
os.Chdir
in an early part ofcoder agent
startup to change the default working directory by anything started by the agent - Switch out
sftp.Server
forsftp.RequestServer
(e.g.sftp.NewRequestServer(session, sftp.InMemHandler(), sftp.WithStartDirectory(os.Getenv("HOME")))
)
Re: 2, I don't know ifsftp.RequestServer
can work as a drop-in replacement, the documentation is quite vague.
Definition of done
- The user lands in
$HOME
when usingsftp