MCPcopy
hub / github.com/esm-dev/esm.sh / Next

Method Next

cli/utils.go:22–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22func (t *termRaw) Next() byte {
23 oldState, err := term.MakeRaw(t.fd)
24 if err != nil {
25 panic(err)
26 }
27 defer term.Restore(t.fd, oldState)
28
29 buf := make([]byte, 3)
30 n, err := os.Stdin.Read(buf)
31 if err != nil {
32 panic(err)
33 }
34
35 // The third byte is the key specific value we are looking for.
36 // See: https://en.wikipedia.org/wiki/ANSI_escape_code
37 if n == 3 {
38 return buf[2]
39 }
40
41 return buf[0]
42}
43
44func (t *termRaw) GetSize() (width int, height int, err error) {
45 return term.GetSize(t.fd)

Callers 15

tidyFunction · 0.80
updateImportMapFunction · 0.80
showMethod · 0.80
pprofRouterFunction · 0.80
SnapshotMethod · 0.80
corsFunction · 0.80
customLandingPageFunction · 0.80
pprofRouterFunction · 0.80
esmLegacyRouterFunction · 0.80
legacyESMFunction · 0.80
loadNodeRuntimeFunction · 0.80

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected