Description
1. OneSec constant is 100ms, not 1 second β intheshell.go, line 18
const (
OneMSec = 1000 * 1000 // One millisecond
OneSec = 1000 * 1000 * 100 // One second
)
1000 * 1000 * 100 = 100,000,000 nanoseconds = 100ms, not 1 second.
One second should be 1000 * 1000 * 1000 (or just use time.Second). This means all time.Sleep(OneSec * 5) calls only sleep 500ms instead of 5s.
2. Signal channel should be buffered β line 149
c := make(chan os.Signal)
Per Go documentation, signal.Notify requires a buffered channel. An unbuffered channel risks missing signals. Fix: make(chan os.Signal, 1)
3. centrifyText doesn't handle multibyte/wide characters
len(inText) counts bytes, not display width. For non-ASCII text, centering will be off.
File
intheshell.go
Suggested Fix
const (
OneMSec = time.Millisecond
OneSec = time.Second
)
And use time.Sleep(5 * OneSec) etc.
Description
1. OneSec constant is 100ms, not 1 second β
intheshell.go, line 181000 * 1000 * 100 = 100,000,000 nanoseconds = 100ms, not 1 second.One second should be
1000 * 1000 * 1000(or just usetime.Second). This means alltime.Sleep(OneSec * 5)calls only sleep 500ms instead of 5s.2. Signal channel should be buffered β line 149
Per Go documentation,
signal.Notifyrequires a buffered channel. An unbuffered channel risks missing signals. Fix:make(chan os.Signal, 1)3. centrifyText doesn't handle multibyte/wide characters
len(inText)counts bytes, not display width. For non-ASCII text, centering will be off.File
intheshell.goSuggested Fix
And use
time.Sleep(5 * OneSec)etc.