[vim/vim] Control the ambiguous width character in Windows 10 (1903)'s :terminal (#4411)

118 views
Skip to first unread message

Nobuhiro Takasaki

unread,
May 22, 2019, 12:16:08 PM5/22/19
to vim/vim, Subscribed

A patch for handling ambiguous width characters in ConPTY on Windows 10 (1903).
A bug in libvterm's internal buffer, which needed to be fixed together.

The logic has been changed again in Insider preview. However, Microsoft needs to resolve this issue first.
microsoft/terminal#724


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/4411

Commit Summary

  • Control the ambiguous width character

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Nobuhiro Takasaki

unread,
May 22, 2019, 3:32:52 PM5/22/19
to vim/vim, Push

@ntak pushed 1 commit.


You are receiving this because you are subscribed to this thread.

View it on GitHub

Bram Moolenaar

unread,
May 22, 2019, 4:58:33 PM5/22/19
to vim/vim, Subscribed

Can a few people try this out? On different MS-Windows versions, ideally.

Codecov

unread,
May 22, 2019, 5:09:20 PM5/22/19
to vim/vim, Subscribed

Codecov Report

Merging #4411 into master will decrease coverage by 0.02%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@

##           master    #4411      +/-   ##

==========================================

- Coverage   80.39%   80.37%   -0.03%     

==========================================

  Files         109      109              

  Lines      142726   142778      +52     

==========================================

+ Hits       114750   114755       +5     

- Misses      27976    28023      +47
Impacted Files Coverage Δ
src/libvterm/src/vterm_internal.h 100% <ø> (ø) ⬆️
src/misc2.c 83.96% <0%> (-0.12%) ⬇️
src/libvterm/src/state.c 89.51% <20.83%> (-1.58%) ⬇️
src/libvterm/src/termscreen.c 88.68% <27.77%> (-2.42%) ⬇️
src/libvterm/src/parser.c 90.16% <40%> (-1.41%) ⬇️
src/libvterm/src/unicode.c 89.13% <57.14%> (-5.75%) ⬇️
src/gui_gtk_x11.c 48.35% <0%> (-0.3%) ⬇️
src/ex_cmds2.c 87.8% <0%> (-0.12%) ⬇️
src/ex_cmds.c 82.18% <0%> (-0.1%) ⬇️
src/gui.c 57.99% <0%> (-0.06%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c017b2...e9d8933. Read the comment docs.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or mute the thread.

Nobuhiro Takasaki

unread,
May 23, 2019, 12:41:21 PM5/23/19
to vim/vim, Subscribed

People have not yet tested it.
The operation check was done with Vista, 7, Win10 (1607), Win10 (1809), Win10 (1903), Insider build 18898.

The display of ambiguios characters on Win10 (1809) is buggy and can not be fixed in userland.
The cursor turns red in Insider build 18898. Since the transmitted sequence is also super buggy, I have to look at it.

This patch makes the little buggy Win10 (1903) ConPTY work properly.

This works with winpty. It only responds to ConPTY sequences.

Bram Moolenaar

unread,
May 24, 2019, 3:57:16 PM5/24/19
to vim/vim, Subscribed

The changes in libvterm are different from other optional flags. Please discuss this with the libvterm author, Paul Evans. I would like to keep the Vim copy of libvterm close to the original, as well as we can.

The return value of vterm_get_special_pty_type() is unclear. It seems that only the value 2 matters. Perhaps it can just return true/fals?

Christian Brabandt

unread,
May 25, 2019, 4:12:58 AM5/25/19
to vim/vim, Subscribed

ping @leonerd

Nobuhiro Takasaki

unread,
May 25, 2019, 9:08:59 PM5/25/19
to vim/vim, Subscribed

The reason for not making it true/fals, special exceptions will increase in the future.

For an environment where the number is 0 and not related to ConPTY.
The number is 1, which is reserved for Windows 10 (1809 or earlier). However, ConPTY seems to be broken, so I do not know if I can correct it.
The number is 2, Windows 10 (1903). This is also broken but corrected.

InsiderBuild has been changed to ConPTY, which requires a value of 3. The logic of 2 can not be used anymore. This ConPTY (now Build 18898) has problems with correction, as the cursor is red and it is overly broken, such as drawing dust.

ConPTY and WindowsTerminal are API compatible but behave differently and can not be identified (the device ID is the same), probably the number is 4.

The current patch is combined with the libvterm bug fix, so I'll start by separating it.

Bram Moolenaar

unread,
Sep 10, 2019, 4:17:33 PM9/10/19
to vim/vim, Subscribed

Is there still work planned on this?

Nobuhiro Takasaki

unread,
Sep 11, 2019, 7:44:04 AM9/11/19
to vim/vim, Push

@ntak pushed 1 commit.

  • 9c0e945 Merge remote-tracking branch 'upstream/master' into control_ambiwidth


You are receiving this because you are subscribed to this thread.

View it on GitHub

Nobuhiro Takasaki

unread,
Sep 11, 2019, 8:11:10 AM9/11/19
to vim/vim, Subscribed

Insider build does not fix a bug that cannot display 2 cell characters.
microsoft/terminal#724
If this is not fixed, there is nothing I can do now.

There is no more work planned.

Bram Moolenaar

unread,
Sep 11, 2019, 4:55:05 PM9/11/19
to vim/vim, Subscribed

Nobuhiro Takasaki wrote:

> Insider build does not fix a bug that cannot display 2 cell characters.
> https://github.com/microsoft/terminal/issues/724

> If this is not fixed, there is nothing I can do now.
>
> There is no more work planned.

To be clear: Despite the bug in the Windows 10 terminal, this pull
request should be included?

--
hundred-and-one symptoms of being an internet addict:
241. You try to look for Net Search even when you're in File Manager.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Nobuhiro Takasaki

unread,
Sep 12, 2019, 8:01:30 PM9/12/19
to vim/vim, Subscribed

It's an easy-to-understand and fatal bug in Windows, but it has been left for more than four months.
Problem with WriteConsoleOutputW().

I think applying a patch is a better way to fix this problem than continuing to pray.

Bram Moolenaar

unread,
Sep 13, 2019, 4:30:43 PM9/13/19
to vim/vim, Subscribed

Closed #4411 via 57da698.

Reply all
Reply to author
Forward
0 new messages