peco / peco

Simplistic interactive filtering tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

2016-09-05

type Ctrl-N

2016-09-05 1

type Ctrl-N

2016-09-05 2

Seems like a Windows issue?

image

@mattn Looks like I'm using the latest go-runewidth (mattn/go-runewidth@d6bea18)

commented

@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

On Raster Font, the screen is not broken !
2016-09-05 3

The font is invalid, isn't it ?

Not only on Windows10 at home, but also on Windows7 in my office ,

  • On Raster font -> Ok
  • Not Raster font (TrueTyped MS Gothic) -> NG

So, I consider peco.exe has no problems. I would like to close this issue. Thanks @lestrrat and @mattn !

We should add this in the FAQ