ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.92k stars 461 forks source link

incorrect encoding in command mode #639

Closed SolitaryN closed 1 year ago

SolitaryN commented 1 year ago

Feature description

like in normal mode to type: :!gcc % && a.out

Additional information

No response

SolitaryN commented 1 year ago

I can run it in nvim, but i can't get the right react and answer of the command

CharlesChiuGit commented 1 year ago

No idea what your desire result is. please be specific.

ayamir commented 1 year ago

Your command is incorrect. The correct way is !gcc % && ./a.out. BTW, I don't know this command whether works on windows.

SolitaryN commented 1 year ago

Oops, that's my fault, i didn't not realize that it is Windows. And the correct command in Windows is :!gcc % && .\a.exe

CharlesChiuGit commented 1 year ago

@SolitaryN so is the problem solved?

SolitaryN commented 1 year ago

But there are still some problem in the text format generated by the command in Windows. like below: image

the command output format in nvim is not right.

CharlesChiuGit commented 1 year ago

can confirmed. it happens in other places too, for example, plugin installation failed, but i'm not sure how to fix it. it seems like an encoding issue.

Jint-lzxy commented 1 year ago

We need some additional information (fill in all queries that are in bold [i.e., replace \<your-response> with your answer] and tick all applicable checkboxes):

Raw markdown (please copy this)

```````markdown - **Your $TERM environment variable:** _\_ - **Your operating system & version:** _\_ - [ ] My `nvim` supports multibyte text processing (`:echo has("multi_byte")` returns 1). - [ ] This issue **can** be reproduced using other terminal emulators. - [ ] The following command works as expected in PowerShell _(i.e., pwsh renders those texts and icons correctly. When applicable, icons are very close to the crosses but there is no overlap)_: ```pwsh Write-Host ("E492:不是编辑器的命令", "", "", "", "XXXXXXXXX") -Separator " || " ``` - [ ] The above command works as expected in `nvim` (command mode). - **The output of the following command in PowerShell is:** _\_ ```pwsh Write-Host ($OutputEncoding, [System.Console]::InputEncoding, [System.Console]::OutputEncoding) -Separator " | " ``` - **The output of the above command in `nvim` command mode is:** _\_ - **The output of the following commands in neovim:** - `:set encoding?`: _\_ - `:language`: _\_ - `:set fileencodings?`: _\_ ```````


Preview:

cc @CharlesChiuGit @SolitaryN

CharlesChiuGit commented 1 year ago

Half right, half wrong.

In wezterm on win11: image

image

Result: image

Result: image

Result: (same in wezterm's pwsh) image

CharlesChiuGit commented 1 year ago

My screenshots with black background are in wezterm, and those with purple background are in windows terminal.

CharlesChiuGit commented 1 year ago

@SolitaryN can u try this draft? #659

I would like to know if this draft can get the same result on your machine as mine.

SolitaryN commented 1 year ago
CharlesChiuGit commented 1 year ago
  • Your $TERM environment variable: nothing was printed(echo $TERM)

  • Your operating system & version: Windows10 22H2 19045.2604

  • [ x] My nvim supports multibyte text processing (:echo has("multi_byte") returns 1).

  • [x ] This issue can be reproduced using other terminal emulators.

  • [ ] The following command works as expected in PowerShell (i.e., pwsh renders those texts and icons correctly. When applicable, icons are very close to the crosses but there is no overlap):

image

  • [ ] The above command works as expected in nvim (command mode).

image

  • The output of the following command in PowerShell is: _

image

_


Write-Host ($OutputEncoding, [System.Console]::InputEncoding, [System.Console]::OutputEncoding) -Separator " | "
  • The output of the above command in nvim command mode is: image

  • The output of the following commands in neovim:

    • :set encoding?: encoding=utf-8

    • :language: image

    • :set fileencodings?: fileencodings=ucs-bom, utf-8,default,latin1

I think u didn't install any nerdfont?

SolitaryN commented 1 year ago

image I installed cascadia-code, it is nerd-font right?

CharlesChiuGit commented 1 year ago

image

I installed cascadia-code, it is nerd-font right?

it seems like u install it via scoop? i found the scoop version somehow looks different then directly downloaded and install the font from the official repo. can u try reinstall the nerdfont with this manner?( i'm using jetbtainsmono, maybe u can try it, i'm not sure if this make any difference.

also, did u set the font in windows terminal's shell profile?

SolitaryN commented 1 year ago

image yes, i installed it via scoop and I set the font in windows terminal profile.

CharlesChiuGit commented 1 year ago

could u try install jetbrainsmono from the official nerdfont repo? tks!

SolitaryN commented 1 year ago

image there are still wrong format in nvim image

SolitaryN commented 1 year ago

whether have you had this wrong in your nvim on Windows?

image there are still wrong format in nvim image

CharlesChiuGit commented 1 year ago

i think u use the wrong name, check "font settings" to get the correct name.

CharlesChiuGit commented 1 year ago

whether have you had this wrong in your nvim on Windows?

image there are still wrong format in nvim image

check my above comment

CharlesChiuGit commented 1 year ago

@SolitaryN can u try this draft? #659

I would like to know if this draft can get the same result on your machine as mine.

this one

CharlesChiuGit commented 1 year ago

@SolitaryN so does the draft work?

SolitaryN commented 1 year ago

Actually not, I mean maybe it's not suitable to use it in Windows, I will try it in WSL2.

SolitaryN commented 1 year ago

thanks for your help and お世話になってすみませんでした、ありがとう

CharlesChiuGit commented 1 year ago

@SolitaryN I think u will be interested in https://github.com/ayamir/nvimdots/pull/659#issuecomment-1509565509.