Skip to content

Commit

Permalink
update. bugfix x2. \n 1. keepalive bugfix \n 2. list mouseevent bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
blacknon committed Sep 9, 2024
1 parent c7835b6 commit 40f6f92
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 46 deletions.
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.17
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.17 h1:iEMIeYsAJLigapB61i4D3VpdOnFboWpztob0ufhmkhQ=
github.com/blacknon/go-sshlib v0.1.17/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
41 changes: 21 additions & 20 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.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ github.com/blacknon/crypto11
github.com/blacknon/go-nfs-sshlib
github.com/blacknon/go-nfs-sshlib/file
github.com/blacknon/go-nfs-sshlib/helpers
# github.com/blacknon/go-sshlib v0.1.16
# github.com/blacknon/go-sshlib v0.1.17
## explicit; go 1.22.4
github.com/blacknon/go-sshlib
# github.com/blacknon/go-x11auth v0.1.0
Expand Down

0 comments on commit 40f6f92

Please sign in to comment.