Fix #391 - Strip non-printable characters

This commit is contained in:
Junegunn Choi 2015-10-23 01:12:31 +09:00
parent ae04f56dbd
commit 4d709e0dd2

View File

@ -11,6 +11,7 @@ import "C"
import (
"fmt"
"os"
"strings"
"syscall"
"time"
"unicode/utf8"
@ -514,7 +515,12 @@ func MoveAndClear(y int, x int) {
}
func Print(text string) {
C.addstr(C.CString(text))
C.addstr(C.CString(strings.Map(func(r rune) rune {
if r < 32 {
return -1
}
return r
}, text)))
}
func CPrint(pair int, bold bool, text string) {