Explorar el Código

auto update script executed

Toby Chui hace 1 año
padre
commit
a668fbf217
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      mod/sshprox/sshprox.go

+ 5 - 1
mod/sshprox/sshprox.go

@@ -140,7 +140,11 @@ func (i *Instance) CreateNewConnection(listenPort int, username string, remoteIp
 		connAddr = username + "@" + remoteIpAddr
 	}
 	configPath := filepath.Join(filepath.Dir(i.ExecPath), ".gotty")
-	cmd := exec.Command(i.ExecPath, "-w", "-p", strconv.Itoa(listenPort), "--once", "--config", configPath, "ssh", connAddr, "-p", strconv.Itoa(remotePort))
+	title := username + "@" + remoteIpAddr
+	if remotePort != 22 {
+		title = title + ":" + strconv.Itoa(remotePort)
+	}
+	cmd := exec.Command(i.ExecPath, "-w", "-p", strconv.Itoa(listenPort), "--once", "--config", configPath, "--title-format", title, "ssh", connAddr, "-p", strconv.Itoa(remotePort))
 	cmd.Dir = filepath.Dir(i.ExecPath)
 	cmd.Stdout = os.Stdout
 	cmd.Stderr = os.Stderr