mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
run localhost mshell with cwd at HOME, not in current directory
This commit is contained in:
parent
f63a851b1a
commit
09a072f900
@ -391,7 +391,12 @@ func (opts SSHOpts) MakeMShellSingleCmd() (*exec.Cmd, error) {
|
||||
func (opts SSHOpts) MakeSSHExecCmd(remoteCommand string) *exec.Cmd {
|
||||
remoteCommand = strings.TrimSpace(remoteCommand)
|
||||
if opts.SSHHost == "" {
|
||||
homeDir, _ := os.UserHomeDir() // ignore error
|
||||
if homeDir == "" {
|
||||
homeDir = "/"
|
||||
}
|
||||
ecmd := exec.Command("bash", "-c", remoteCommand)
|
||||
ecmd.Dir = homeDir
|
||||
return ecmd
|
||||
} else {
|
||||
var moreSSHOpts []string
|
||||
|
Loading…
Reference in New Issue
Block a user