MCPcopy Index your code
hub / github.com/UserExistsError/conpty

github.com/UserExistsError/conpty @v0.1.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.4 ↗ · + Follow
31 symbols 55 edges 3 files 5 documented · 16% 4 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

conpty

Windows Pseudo Console (ConPTY) for Golang

See:

https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/

Usage

package main

import (
    "context"
    "io"
    "log"
    "os"

    "github.com/UserExistsError/conpty"
)

func main() {
    commandLine := `c:\windows\system32\cmd.exe`
    cpty, err := conpty.Start(commandLine)
    if err != nil {
        log.Fatalf("Failed to spawn a pty:  %v", err)
    }
    defer cpty.Close()

    go io.Copy(os.Stdout, cpty)
    go io.Copy(cpty, os.Stdin)

    exitCode, err := cpty.Wait(context.Background())
    if err != nil {
        log.Fatalf("Error: %v", err)
    }
    log.Printf("ExitCode: %d", exitCode)
}

Extension points exported contracts — how you extend this code

ConPtyOption (FuncType)
(no doc)
conpty.go

Core symbols most depended-on inside this repo

closeHandles
called by 4
conpty.go
Write
called by 4
conpty.go
Pack
called by 2
conpty.go
win32ClosePseudoConsole
called by 2
conpty.go
Close
called by 2
conpty.go
Wait
called by 2
conpty.go
Start
called by 2
conpty.go
IsConPtyAvailable
called by 1
conpty.go

Shape

Function 14
Method 10
Struct 5
FuncType 1
TypeAlias 1

Languages

Go100%

Modules by API surface

conpty.go29 symbols
examples/write/main.go1 symbols
examples/cmd/main.go1 symbols

For agents

$ claude mcp add conpty \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact