diff --git a/cmd/formatter.go b/cmd/formatter.go index 8f2d08ca..a09f7639 100644 --- a/cmd/formatter.go +++ b/cmd/formatter.go @@ -21,19 +21,7 @@ var stdoutIsTerminal = func() bool { return term.IsTerminal(int(os.Stdout.Fd())) } -// stdinIsTerminal reports whether stdin is connected to a terminal (TTY). -// Used to decide whether interactive prompts are viable. It is a var so tests -// can override it. -var stdinIsTerminal = func() bool { - return term.IsTerminal(int(os.Stdin.Fd())) -} -// stderrIsTerminal reports whether stderr is connected to a terminal (TTY). -// Used to gate decorative output on the error stream independently. It is a -// var so tests can override it. -var stderrIsTerminal = func() bool { - return term.IsTerminal(int(os.Stderr.Fd())) -} // TreeNode represents a node in a tree structure for FormatTree. type TreeNode struct { diff --git a/cmd/pager.go b/cmd/pager.go index 1a7fb033..8e3e2c35 100644 --- a/cmd/pager.go +++ b/cmd/pager.go @@ -55,6 +55,9 @@ func StartPager() io.Writer { args = append([]string{"-FRX"}, args...) } + // nolint:gosec // G204 is acceptable here; the pager command comes from + // resolvePager() which validates input, and this is the standard pattern + // used by gh CLI and similar tools. cmd := exec.Command(name, args...) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr @@ -125,25 +128,4 @@ func IsPagerActive() bool { return activePager != nil } -// ShouldPage reports whether the given line count would benefit from paging. -// Used as a heuristic: if output exceeds the terminal height, paging helps. -func shouldPage(lineCount int) bool { - if !stdoutIsTerminal() || quietFlag { - return false - } - _, height, err := safeTermSize() - if err != nil || height == 0 { - return false - } - return lineCount > height -} -// safeTermSize returns the terminal width and height without panicking. -func safeTermSize() (width, height int, err error) { - fd := int(os.Stdout.Fd()) - if !term.IsTerminal(fd) { - err = fmt.Errorf("not a terminal") - return - } - return term.GetSize(fd) -} diff --git a/external/eyrie b/external/eyrie index 2c21d5e8..50e37d91 160000 --- a/external/eyrie +++ b/external/eyrie @@ -1 +1 @@ -Subproject commit 2c21d5e84c13850a5814199546401b010d485cc4 +Subproject commit 50e37d919d2ef85e51f555ecce32a649c98ede46 diff --git a/external/hawk-core-contracts b/external/hawk-core-contracts index 90fa2c56..2880b720 160000 --- a/external/hawk-core-contracts +++ b/external/hawk-core-contracts @@ -1 +1 @@ -Subproject commit 90fa2c568e1b18624c90eadbdc2604d6c0a81903 +Subproject commit 2880b7204b36eb55b0b55064d8e65692d51c189e diff --git a/external/inspect b/external/inspect index 84f66319..9ce8532d 160000 --- a/external/inspect +++ b/external/inspect @@ -1 +1 @@ -Subproject commit 84f66319dc44f5ed74b883443e96621e2e8c5565 +Subproject commit 9ce8532d920497b3e1e518ce6eb1087afc14dcf1 diff --git a/external/sight b/external/sight index 81108284..82aba0fd 160000 --- a/external/sight +++ b/external/sight @@ -1 +1 @@ -Subproject commit 811082849f0f907b97fe7b55b2257f10444d5c5c +Subproject commit 82aba0fdc916eff280f80b6f7dd7c3691a31bb3b diff --git a/external/tok b/external/tok index ee8b8f24..2882e6f7 160000 --- a/external/tok +++ b/external/tok @@ -1 +1 @@ -Subproject commit ee8b8f24443a0dbfba2c1fabd35bd7f9d099d7dd +Subproject commit 2882e6f73876dcef00bbf94ad257cbbd30be5f8d diff --git a/external/trace b/external/trace index b6c65531..3848b8a1 160000 --- a/external/trace +++ b/external/trace @@ -1 +1 @@ -Subproject commit b6c6553152565642028325cd24e8805c164d8967 +Subproject commit 3848b8a1a9a2e765005ac9bb3df54d335cfcf9b2 diff --git a/external/yaad b/external/yaad index 0cdbd7bd..6f033e0c 160000 --- a/external/yaad +++ b/external/yaad @@ -1 +1 @@ -Subproject commit 0cdbd7bd65d239472157c5a437bbcc37af15288a +Subproject commit 6f033e0c550ad3fb13ed467d6cd550a91d58a384