mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-05-22 10:15:43 +02:00
8a1f965e64
Bumps [github.com/creack/pty](https://github.com/creack/pty) from 1.1.11 to 1.1.24. - [Release notes](https://github.com/creack/pty/releases) - [Commits](https://github.com/creack/pty/compare/v1.1.11...v1.1.24) --- updated-dependencies: - dependency-name: github.com/creack/pty dependency-version: 1.1.24 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
25 lines
636 B
Go
25 lines
636 B
Go
package pty
|
|
|
|
import "os"
|
|
|
|
// InheritSize applies the terminal size of pty to tty. This should be run
|
|
// in a signal handler for syscall.SIGWINCH to automatically resize the tty when
|
|
// the pty receives a window size change notification.
|
|
func InheritSize(pty, tty *os.File) error {
|
|
size, err := GetsizeFull(pty)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return Setsize(tty, size)
|
|
}
|
|
|
|
// Getsize returns the number of rows (lines) and cols (positions
|
|
// in each line) in terminal t.
|
|
func Getsize(t *os.File) (rows, cols int, err error) {
|
|
ws, err := GetsizeFull(t)
|
|
if err != nil {
|
|
return 0, 0, err
|
|
}
|
|
return int(ws.Rows), int(ws.Cols), nil
|
|
}
|