Skip to content

Commit

Permalink
Merge pull request #144 from blacknon/develop
Browse files Browse the repository at this point in the history
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
  • Loading branch information
blacknon authored Sep 9, 2024
2 parents c64840c + 99677c3 commit 105ec27
Show file tree
Hide file tree
Showing 14 changed files with 163 additions and 63 deletions.
2 changes: 1 addition & 1 deletion cmd/lscp/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ USAGE:
app.Name = "lscp"
app.Usage = "TUI list select and parallel scp client command."
app.Copyright = "blacknon([email protected])"
app.Version = "0.6.12"
app.Version = "0.6.13"

// options
// TODO(blacknon): オプションの追加(0.7.0)
Expand Down
2 changes: 1 addition & 1 deletion cmd/lsftp/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ USAGE:
app.Name = "lsftp"
app.Usage = "TUI list select and parallel sftp client command."
app.Copyright = "blacknon([email protected])"
app.Version = "0.6.12"
app.Version = "0.6.13"

app.Flags = []cli.Flag{
cli.StringFlag{Name: "file,F", Value: defConf, Usage: "config file path"},
Expand Down
2 changes: 1 addition & 1 deletion cmd/lssh/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ USAGE:
app.Name = "lssh"
app.Usage = "TUI list select and parallel ssh client command."
app.Copyright = "blacknon([email protected])"
app.Version = "0.6.12"
app.Version = "0.6.13"

// TODO(blacknon): オプションの追加
// -T ... マウント・リバースマウントのTypeを指定できるようにする(v0.7.0)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 // indirect
github.com/blacknon/crypto11 v1.2.7 // indirect
github.com/blacknon/go-sshlib v0.1.16
github.com/blacknon/go-sshlib v0.1.18
github.com/blacknon/go-x11auth v0.1.0 // indirect
github.com/blacknon/textcol v0.0.1
github.com/c-bata/go-prompt v0.2.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ github.com/blacknon/go-nfs-sshlib v0.0.3 h1:tq83kTZibrr99/GCn0pqkJhmBTDMupL/eMI3
github.com/blacknon/go-nfs-sshlib v0.0.3/go.mod h1:jaCmHgFoj8j08rGrBnhJ4nFO7nUWs4xFrUd2vEPwyx8=
github.com/blacknon/go-prompt v0.2.7 h1:dVdTqVplKvpT/k4bB9BlbcBYl/k6amYX5tvjYBmuKkI=
github.com/blacknon/go-prompt v0.2.7/go.mod h1:zNBmC/BPAyr+3ey1oRhPxuXJS9zz1lEmJpwaoQroe3w=
github.com/blacknon/go-sshlib v0.1.16 h1:de5KXEYalMzknPWwSbKEr/Z3CxgOfMyiQC5+sfzYwLg=
github.com/blacknon/go-sshlib v0.1.16/go.mod h1:upfnjVHf/Lh7ysT3dU1ziHKtzRQ1J62JyrShZ7FlNSI=
github.com/blacknon/go-sshlib v0.1.18 h1:gzkplZuAH2aHARng2YbiEjzGufZomPdGoMQuqmdA2R0=
github.com/blacknon/go-sshlib v0.1.18/go.mod h1:DN5Vkl/FpEzVxGoS0p8uBsBoHpVywiHbALr9UxcfJxw=
github.com/blacknon/go-x11auth v0.1.0 h1:SnljCPWcvglWeGAlKc1RAPMHnOfMpM9+GrTGEUQ1lqQ=
github.com/blacknon/go-x11auth v0.1.0/go.mod h1:SKOCa19LluXHyB+OaLYobquzceE0SWxVW7e/qU5xGBM=
github.com/blacknon/textcol v0.0.1 h1:x9h7yLPGyr8Pdz12XJ30h7Iz5mJlKd0CzfGYxhrmnk8=
Expand Down
5 changes: 3 additions & 2 deletions list/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ func (l *ListInfo) keyEvent() (lineData []string) {
// mouse select line is (ev.MouseY - headLine) line.
mouseSelectLine := ev.MouseY - headLine

if mouseSelectLine <= len(l.ViewText)-headLine {
l.CursorLine = mouseSelectLine
pageOffset := (l.CursorLine / height) * height
if mouseSelectLine >= 0 && mouseSelectLine < height && pageOffset+mouseSelectLine < len(l.ViewText) {
l.CursorLine = pageOffset + mouseSelectLine
}
l.draw()
}
Expand Down
11 changes: 10 additions & 1 deletion ssh/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/blacknon/go-sshlib"
"github.com/blacknon/lssh/conf"
"golang.org/x/crypto/ssh"
"golang.org/x/net/proxy"
)

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

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

return
if err != nil {
if client, ok := dialer.(*ssh.Client); ok {
client.Close()
}

return nil, err
}

return connect, nil
}

// proxy struct
Expand Down
43 changes: 30 additions & 13 deletions vendor/github.com/blacknon/go-sshlib/cmd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 23 additions & 19 deletions vendor/github.com/blacknon/go-sshlib/connect.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions vendor/github.com/blacknon/go-sshlib/nfs_forward.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 15 additions & 19 deletions vendor/github.com/blacknon/go-sshlib/nfs_sftpfs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions vendor/github.com/blacknon/go-sshlib/proxy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 105ec27

Please sign in to comment.