aaronjanse / 3mux

Terminal multiplexer inspired by i3
MIT License
1.82k stars 45 forks source link

Does not respect multi-byte characters. #37

Open mattn opened 4 years ago

mattn commented 4 years ago

Current implementation does not respect double-width multi-byte characters.

$ cat foo
あいうえお

image

$ 3mux
$ cat foo

image

aaronjanse commented 4 years ago

Do you have any tips for how I can test this? What terminal & font are you using?

mattn commented 4 years ago

If you are using Linux ubuntu, please try to install fonts-ipaexfont-gothic or fonts that can display Japanese text. This issue can be reproduced on gnome-terminal on Ubuntu too. But I'm always using mintty on Windows.

aaronjanse commented 4 years ago

Fixed by edb22da.

You can update 3mux via go get -u github.com/aaronjanse/3mux. Please re-open this issue if it's not fixed on your end (it is on mine).

Thanks for filing a bug report and helping me reproduce the issue!

mattn commented 4 years ago

Thanks for fixing this. Some of issues are fixed but still remaining some.

  1. type multi-byte characters

image

  1. type backspace

image

Expected behavior is

image

It seems that I don't have permission to re-open this.

aaronjanse commented 4 years ago

Did someone say... support for wide characters is now in master as of https://github.com/aaronjanse/3mux/commit/34864850f95615449f3aeb146bfd8db1531b7e02?!?!?

I'm so sorry that multi-byte characters weren't supported in the first place. It must be a pain to use most software.

Btw, I hope you know your open-source work is seriously appreciated. I've used several of your libraries in the past, and I used your rune width library for the above commit :-)

mattn commented 4 years ago

Thanks your working on this. 3486485 seems to be working fine with respect to the display multi-byte characters, as far as I can see. I'm having problems editing.

aaronjanse commented 4 years ago

Oh weird. I made a few typos in https://github.com/aaronjanse/3mux/commit/34864850f95615449f3aeb146bfd8db1531b7e02 [1] (yes, yes, I'll setup a dev branch). Could you try updating again and seeing if you still have issues?

EDIT: and if you do, would you mind specifying what exactly isn't working?

mattn commented 4 years ago

Okay, will do tonight.

mattn commented 4 years ago

In latest commit, displaying/editing multi-byte characters seems to be working well. But sometime does not work. Currently, I don't yet figure out when this occur.

mattn commented 4 years ago

Trailing cell of double-width seems broken. screenshot

aaronjanse commented 4 years ago

Thank you so much for the GIF! I've pushed a fix to the dev branch. I wasn't setting the style of the second column to the same style as the first column of these wide characters.

Side note I should probably make that lime green status bar less ugly.

aaronjanse commented 4 years ago

This should be fixed in v0.2.0 on master. Thank you for writing go-runewidth!