summaryrefslogtreecommitdiffstats
path: root/internal/utils/tty.go
diff options
context:
space:
mode:
authorsinner <[email protected]>2026-04-15 15:16:02 -0400
committersinner <[email protected]>2026-04-15 15:16:02 -0400
commita5f907854f29e1c267ad30d1dfe85c2c47f5ac48 (patch)
treebc8685c3b22e6d5d47702ba0607c694f938ba7fd /internal/utils/tty.go
parent8a1cf20dd5014ebe15ced77344902b79dcfa2e66 (diff)
downloaddborg-master.tar.gz
dborg-master.zip
feat: add stdin support and retry logic for all search commandsHEADv1.1.1v0.1.14master
Diffstat (limited to 'internal/utils/tty.go')
-rw-r--r--internal/utils/tty.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/utils/tty.go b/internal/utils/tty.go
new file mode 100644
index 0000000..4ac367d
--- /dev/null
+++ b/internal/utils/tty.go
@@ -0,0 +1,19 @@
+package utils
+
+import (
+ "os"
+
+ "golang.org/x/term"
+)
+
+func IsTerminal() bool {
+ return term.IsTerminal(int(os.Stdout.Fd()))
+}
+
+func IsStderrTerminal() bool {
+ return term.IsTerminal(int(os.Stderr.Fd()))
+}
+
+func isTerminal() bool {
+ return IsTerminal()
+}