diff --git a/root/term_sync.go b/root/term_sync.go new file mode 100644 index 0000000..ba8e9f3 --- /dev/null +++ b/root/term_sync.go @@ -0,0 +1,14 @@ +package root + +import ( + "os" + "sync" +) + +var termMutex sync.Mutex + +func TermWrite(data []byte) { + termMutex.Lock() + defer termMutex.Unlock() + os.Stdout.Write(data) +}