Skip to content

utils.go functions to not require os.File #86

@antonio-osorio

Description

@antonio-osorio

Would you be open to modify the signature of the functions in utils.go:

  • InheritSize
  • SetSize
  • GetSizeFull
  • GetSize

to either accept a File-like interface:

type FileLike interface {
	Fd() uintptr
}

or to just require the the File descriptor myFile.Fd() instead of the os.File concrete struct?

func InheritSize(ptyFd, ttyFd uintptr) error {
...
}

If I am not mistaken otherwise it requires the caller to unnecessarily create a os.File object:

var myFileLike FileLike
myFile := os.NewFile(myFileLike.Fd(), "")
pty.InheritSize(myFile, myOtherFile)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions