From faa4de4a0c187cca6aa9faf0cf403266a9738f76 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 7 May 2024 20:20:20 +0200 Subject: fix --- src/c_exec.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/c_exec.go') diff --git a/src/c_exec.go b/src/c_exec.go index 5afca7a..eb711cd 100644 --- a/src/c_exec.go +++ b/src/c_exec.go @@ -265,6 +265,7 @@ func c_exec(host *HostNode, opts HardOpts, ui *HardUI) { if host == nil { return } + save_host, save_port := host.Host, host.Port tmp_host := host if host.Protocol == PROTOCOL_RDP && len(host.Jump.Host) != 0 { local_host := "127.0.0.1" @@ -277,6 +278,10 @@ func c_exec(host *HostNode, opts HardOpts, ui *HardUI) { tmp_host.Port = local_port } cmd_fmt, cmd_env := c_format_cmd(tmp_host, opts, ui) + if tmp_host.Port != save_port { + tmp_host.Host = save_host + tmp_host.Port = save_port + } if cmd_fmt == nil { return } -- cgit v1.2.3