summaryrefslogtreecommitdiff
path: root/terminal_width.go
diff options
context:
space:
mode:
authorCastor Gemini <[email protected]>2025-08-24 08:39:59 -0500
committerJeff Carr <[email protected]>2025-08-24 08:39:59 -0500
commitcd170de6777c517920abf7894c9dc2379fb12e5a (patch)
treed6f176c35f9cf46499e8db2e58f6cf2421d41965 /terminal_width.go
parent357c20027fda714af0e08b3f9ddf89edfeb6ef39 (diff)
feat(playback): Improve formatting of long playback
Diffstat (limited to 'terminal_width.go')
-rw-r--r--terminal_width.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/terminal_width.go b/terminal_width.go
new file mode 100644
index 0000000..3421330
--- /dev/null
+++ b/terminal_width.go
@@ -0,0 +1,16 @@
+package main
+
+import (
+ "os"
+
+ "golang.org/x/term"
+)
+
+func getTerminalWidth() int {
+ width, _, err := term.GetSize(int(os.Stdout.Fd()))
+ if err != nil {
+ // Return a default width if there's an error
+ return 80
+ }
+ return width
+} \ No newline at end of file