Skip to content

Commit 105ec27

Browse files
authored
Merge pull request #144 from blacknon/develop
version 0.6.13 - bugfix: when selecting a server from the second page onwards using the mouse. - bugfix: Corrected to disconnect if ssh connection is made using Proxy when ssh connection fails. - update go-sshlib. v0.1.16 to v0.1.18
2 parents c64840c + 99677c3 commit 105ec27

File tree

14 files changed

+163
-63
lines changed

14 files changed

+163
-63
lines changed

cmd/lscp/args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ USAGE:
5858
app.Name = "lscp"
5959
app.Usage = "TUI list select and parallel scp client command."
6060
app.Copyright = "blacknon([email protected])"
61-
app.Version = "0.6.12"
61+
app.Version = "0.6.13"
6262

6363
// options
6464
// TODO(blacknon): オプションの追加(0.7.0)

cmd/lsftp/args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ USAGE:
5050
app.Name = "lsftp"
5151
app.Usage = "TUI list select and parallel sftp client command."
5252
app.Copyright = "blacknon([email protected])"
53-
app.Version = "0.6.12"
53+
app.Version = "0.6.13"
5454

5555
app.Flags = []cli.Flag{
5656
cli.StringFlag{Name: "file,F", Value: defConf, Usage: "config file path"},

cmd/lssh/args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ USAGE:
5959
app.Name = "lssh"
6060
app.Usage = "TUI list select and parallel ssh client command."
6161
app.Copyright = "blacknon([email protected])"
62-
app.Version = "0.6.12"
62+
app.Version = "0.6.13"
6363

6464
// TODO(blacknon): オプションの追加
6565
// -T ... マウント・リバースマウントのTypeを指定できるようにする(v0.7.0)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
1414
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 // indirect
1515
github.com/blacknon/crypto11 v1.2.7 // indirect
16-
github.com/blacknon/go-sshlib v0.1.16
16+
github.com/blacknon/go-sshlib v0.1.18
1717
github.com/blacknon/go-x11auth v0.1.0 // indirect
1818
github.com/blacknon/textcol v0.0.1
1919
github.com/c-bata/go-prompt v0.2.6

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ github.com/blacknon/go-nfs-sshlib v0.0.3 h1:tq83kTZibrr99/GCn0pqkJhmBTDMupL/eMI3
1616
github.com/blacknon/go-nfs-sshlib v0.0.3/go.mod h1:jaCmHgFoj8j08rGrBnhJ4nFO7nUWs4xFrUd2vEPwyx8=
1717
github.com/blacknon/go-prompt v0.2.7 h1:dVdTqVplKvpT/k4bB9BlbcBYl/k6amYX5tvjYBmuKkI=
1818
github.com/blacknon/go-prompt v0.2.7/go.mod h1:zNBmC/BPAyr+3ey1oRhPxuXJS9zz1lEmJpwaoQroe3w=
19-
github.com/blacknon/go-sshlib v0.1.16 h1:de5KXEYalMzknPWwSbKEr/Z3CxgOfMyiQC5+sfzYwLg=
20-
github.com/blacknon/go-sshlib v0.1.16/go.mod h1:upfnjVHf/Lh7ysT3dU1ziHKtzRQ1J62JyrShZ7FlNSI=
19+
github.com/blacknon/go-sshlib v0.1.18 h1:gzkplZuAH2aHARng2YbiEjzGufZomPdGoMQuqmdA2R0=
20+
github.com/blacknon/go-sshlib v0.1.18/go.mod h1:DN5Vkl/FpEzVxGoS0p8uBsBoHpVywiHbALr9UxcfJxw=
2121
github.com/blacknon/go-x11auth v0.1.0 h1:SnljCPWcvglWeGAlKc1RAPMHnOfMpM9+GrTGEUQ1lqQ=
2222
github.com/blacknon/go-x11auth v0.1.0/go.mod h1:SKOCa19LluXHyB+OaLYobquzceE0SWxVW7e/qU5xGBM=
2323
github.com/blacknon/textcol v0.0.1 h1:x9h7yLPGyr8Pdz12XJ30h7Iz5mJlKd0CzfGYxhrmnk8=

list/event.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ func (l *ListInfo) keyEvent() (lineData []string) {
150150
// mouse select line is (ev.MouseY - headLine) line.
151151
mouseSelectLine := ev.MouseY - headLine
152152

153-
if mouseSelectLine <= len(l.ViewText)-headLine {
154-
l.CursorLine = mouseSelectLine
153+
pageOffset := (l.CursorLine / height) * height
154+
if mouseSelectLine >= 0 && mouseSelectLine < height && pageOffset+mouseSelectLine < len(l.ViewText) {
155+
l.CursorLine = pageOffset + mouseSelectLine
155156
}
156157
l.draw()
157158
}

ssh/connect.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/blacknon/go-sshlib"
1212
"github.com/blacknon/lssh/conf"
13+
"golang.org/x/crypto/ssh"
1314
"golang.org/x/net/proxy"
1415
)
1516

@@ -98,7 +99,15 @@ func (r *Run) CreateSshConnect(server string) (connect *sshlib.Connect, err erro
9899

99100
err = connect.CreateClient(s.Addr, s.Port, s.User, r.serverAuthMethodMap[server])
100101

101-
return
102+
if err != nil {
103+
if client, ok := dialer.(*ssh.Client); ok {
104+
client.Close()
105+
}
106+
107+
return nil, err
108+
}
109+
110+
return connect, nil
102111
}
103112

104113
// proxy struct

vendor/github.com/blacknon/go-sshlib/cmd.go

Lines changed: 30 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/blacknon/go-sshlib/connect.go

Lines changed: 23 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/blacknon/go-sshlib/nfs_forward.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)