github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/pipes/psuedotty/pty_fallback.go (about)

     1  //go:build windows || js || plan9 || no_pty
     2  // +build windows js plan9 no_pty
     3  
     4  package psuedotty
     5  
     6  import (
     7  	"github.com/lmorg/murex/builtins/pipes/streams"
     8  	"github.com/lmorg/murex/lang/stdio"
     9  )
    10  
    11  func init() {
    12  	stdio.RegisterPipe("pty", registerPipe)
    13  }
    14  
    15  func registerPipe(_ string) (stdio.Io, error) {
    16  	return streams.NewStdin(), nil
    17  }
    18  
    19  type PTY struct {
    20  	streams.Stdin
    21  }
    22  
    23  func NewPTY(width, height int) (*PTY, error) {
    24  	pty := PTY{*streams.NewStdin()}
    25  	return &pty, nil
    26  }