Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita61a154

Browse files
committed
Improve start option
1 parente692a18 commita61a154

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

‎agent/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ func (a *agent) handleSSHSession(session ssh.Session) (retErr error) {
688688
cmd.Env=append(cmd.Env,fmt.Sprintf("TERM=%s",sshPty.Term))
689689

690690
// The pty package sets `SSH_TTY` on supported platforms.
691-
ptty,process,err:=pty.Start(cmd,pty.WithPTYOptions(
691+
ptty,process,err:=pty.Start(cmd,pty.WithPTYOption(
692692
pty.WithSSHRequest(sshPty),
693693
pty.WithLogger(slog.Stdlib(ctx,a.logger,slog.LevelInfo)),
694694
))

‎pty/pty_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var (
2121
)
2222

2323
// See: https://docs.microsoft.com/en-us/windows/console/creating-a-pseudoconsole-session
24-
funcnewPty(opt...PTYOption) (PTY,error) {
24+
funcnewPty(opt...Option) (PTY,error) {
2525
varoptsptyOptions
2626
for_,o:=rangeopt {
2727
o(&opts)

‎pty/start.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ type startOptions struct {
1111
ptyOpts []Option
1212
}
1313

14-
//WithPTYOptions applies the given options to the underlying PTY.
15-
funcWithPTYOptions(opts...Option)StartOption {
14+
//WithPTYOption applies the given options to the underlying PTY.
15+
funcWithPTYOption(opts...Option)StartOption {
1616
returnfunc(o*startOptions) {
17-
o.ptyOpts=opts
17+
o.ptyOpts=append(o.ptyOpts,opts...)
1818
}
1919
}
2020

‎pty/start_other_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestStart(t *testing.T) {
4343

4444
t.Run("SSH_TTY",func(t*testing.T) {
4545
t.Parallel()
46-
opts:=pty.WithPTYOptions(pty.WithSSHRequest(ssh.Pty{
46+
opts:=pty.WithPTYOption(pty.WithSSHRequest(ssh.Pty{
4747
Window: ssh.Window{
4848
Width:80,
4949
Height:24,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp