The position to start next line looks wrong when stdin includes Japanese characters
hymkor opened this issue · comments
What is the peco version, OS, architecture?
On Windows 10, the architecture is for 386.
$ peco --version
peco version v0.4.2
Abstract
When stdin includes Japanese characters, the position to start the next line looks wrong.
Discussion
The program to make data for sending to peco
: peco-test.go
(written in utf8)
package main
import "fmt"
func main() {
fmt.Printf("あはは\nいひひ\nうふふ\n")
}
test
peco-test | peco
type Ctrl-N
type Ctrl-N
Seems like a Windows issue?
@mattn Looks like I'm using the latest go-runewidth (mattn/go-runewidth@d6bea18)
@zetamatta What font do you use for cmd.exe ? Maybe not Raster Font`?
Yes, it occurs on Windows. (The prompt is customized like Linux, but on Windows)
peco
I used is the binary releaese v0.4.2
On the latest go-runewidth, do test it.
$ git show
commit d6bea18f789704b5f83375793155289da36a3c7f
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Tue Mar 15 13:07:12 2016 +0900
Remove gocov
diff --git a/.travis.yml b/.travis.yml
index ad584f4..5c9c2a3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,7 +2,6 @@ language: go
go:
- tip
before_install:
- - go get github.com/axw/gocov/gocov
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
script:
package main
import (
"fmt"
"github.com/mattn/go-runewidth"
)
func main(){
for _,c := range "あはは"{
fmt.Printf("len('%c')=%d\n",c,runewidth.RuneWidth(c))
}
}
$ go run runwidth_t.go
len('あ')=2
len('は')=2
len('は')=2
I will collect more information today.
(Yesterday, I saw the source-code(screen.go) and I could not find any problem. Therefore, the problem may exist in my environment. I want to find what is wrong.)
@mattn my font is the TrueTyped MS-Gothic 16pt
We should add this in the FAQ