mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Replace utils.Once with stdlib sync.OnceValue
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
@@ -340,7 +341,7 @@ func (self *Term) GetSize() (*unix.Winsize, error) {
|
||||
// go doesn't have a wrapper for ctermid()
|
||||
func Ctermid() string { return "/dev/tty" }
|
||||
|
||||
var KittyStdout = utils.Once(func() *os.File {
|
||||
var KittyStdout = sync.OnceValue(func() *os.File {
|
||||
if fds := os.Getenv(`KITTY_STDIO_FORWARDED`); fds != "" {
|
||||
if fd, err := strconv.Atoi(fds); err == nil && fd > -1 {
|
||||
if f := os.NewFile(uintptr(fd), "<kitty_stdout>"); f != nil {
|
||||
|
||||
Reference in New Issue
Block a user