Selaa lähdekoodia

auto update script executed

Toby Chui 1 vuosi sitten
vanhempi
commit
a668fbf217
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  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