镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
tjametPublic

About

Go implementation of the python iterm2 library

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

Golang implementation of iterm2 python's remote API

GoDoc

Notice

The code is in early stage and the repository currently doesn't offer all features provided by the python reference implementation

The provided primitives are currently low level

Usage

To list all current iterm sessions, copy the following lines

package main

import (
	"fmt"
	"os"

	log "github.com/sirupsen/logrus"
	iterm2 "github.com/tjamet/goterm2"
	"github.com/tjamet/goterm2/api"
)

func main() {
	logger := log.New()
	logger.SetOutput(os.Stdout)
	logger.SetLevel(log.TraceLevel)
	i, err := iterm2.New()
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
	i.Logger(logger)
	fmt.Println(i.ListSessions(&api.ListSessionsRequest{}))
}

This library requires your iterm to be configured to run the Python API in the menus: iTerm2 > Preferences > general > magic as shown below

You will then need to accept the connection as shown below

About

Go implementation of the python iterm2 library

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages