Skip to content

Commit eb7d106

Browse files
committed
update. support window shell.
1 parent f3ee430 commit eb7d106

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

shell.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (c *Connect) logger(session *ssh.Session) (err error) {
158158

159159
func (c *Connect) setupShell(session *ssh.Session) (err error) {
160160
// set FD
161-
stdin := getStdin()
161+
stdin := GetStdin()
162162
session.Stdin = stdin
163163
session.Stdout = os.Stdout
164164
session.Stderr = os.Stderr

shell_unix.go stdin_unix.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ import (
1111
"os"
1212
)
1313

14-
func getStdin() io.ReadCloser {
14+
func GetStdin() io.ReadCloser {
1515
return os.Stdin
1616
}

shell_windows.go stdin_windows.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
//go:build windows
55
// +build windows
66

7-
// 【参考】
8-
// - https://github.com/tatsushid/minssh/commit/57eae8c5bcf5d94639891f3267f05251f05face4
9-
107
package sshlib
118

129
import (
@@ -16,7 +13,7 @@ import (
1613
"golang.org/x/sys/windows"
1714
)
1815

19-
func getStdin() io.ReadCloser {
16+
func GetStdin() io.ReadCloser {
2017
h := uint32(windows.STD_INPUT_HANDLE)
2118
stdin := windowsconsole.NewAnsiReader(int(h))
2219

0 commit comments

Comments
 (0)