Documentation
¶
Index ¶
- func Exec(shell string) (string, error)
- func ExecWithLog(shell string, logFile string) error
- func Execf(shell string, args ...any) (string, error)
- func ExecfAsync(shell string, args ...any) error
- func ExecfWithDir(dir, shell string, args ...any) (string, error)
- func ExecfWithOutput(shell string, args ...any) error
- func ExecfWithPipe(ctx context.Context, shell string, args ...any) (io.ReadCloser, error)
- func ExecfWithTTY(shell string, args ...any) (string, error)
- func ExecfWithTimeout(timeout time.Duration, shell string, args ...any) (string, error)
- func IsPTYError(err error) error
- type MessagePing
- type MessageResize
- type Turn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecWithLog ¶
ExecWithLog 执行 shell 命令并将输出写入指定的日志文件
func ExecfWithDir ¶
ExecfWithDir 在指定目录下执行 shell 命令
func ExecfWithOutput ¶
ExecfWithOutput 执行 shell 命令并输出到终端
func ExecfWithPipe ¶
ExecfWithPipe 执行 shell 命令并返回管道
func ExecfWithTTY ¶
ExecfWithTTY 在伪终端下执行 shell 命令
func ExecfWithTimeout ¶
ExecfWithTimeout 执行 shell 命令并设置超时时间
func IsPTYError ¶
IsPTYError Linux kernel return EIO when attempting to read from a master pseudo terminal which no longer has an open slave. So ignore error here. See https://github.com/creack/pty/issues/21
Types ¶
type MessageResize ¶
type MessageResize struct {
Resize bool `json:"resize"`
Columns uint `json:"columns"`
Rows uint `json:"rows"`
}
MessageResize 终端大小调整消息
Click to show internal directories.
Click to hide internal directories.