[GH-ISSUE #66] Border Is not Drawn Properly in Windows Command Prompt #46

Closed
opened 2026-03-04 01:01:25 +03:00 by kerem · 6 comments
Owner

Originally created by @joegrasse on GitHub (Mar 8, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/66

When trying to run your Box demo in the windows 10 command prompt, the border is not drawn correctly.

OS: Windows 10
Go: 1.9.4

image

Originally created by @joegrasse on GitHub (Mar 8, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/66 When trying to run your [Box demo](https://github.com/rivo/tview/tree/master/demos/box) in the windows 10 command prompt, the border is not drawn correctly. OS: Windows 10 Go: 1.9.4 ![image](https://user-images.githubusercontent.com/4334144/37174999-ccc6240e-22dd-11e8-91af-b892df2b482c.png)
kerem closed this issue 2026-03-04 01:01:25 +03:00
Author
Owner

@KingRikkie commented on GitHub (Mar 9, 2018):

You sure about this? Works on my end.

As a side note, there will be an offset of one col on the right side if I compile it and run the exe directly or call the *.go file with go run. The offset vanishes if I call the exe from an existing commandline.

Offset

<!-- gh-comment-id:371761488 --> @KingRikkie commented on GitHub (Mar 9, 2018): You sure about this? Works on my end. As a side note, there will be an offset of one col on the right side if I compile it and run the exe directly or call the *.go file with `go run`. The offset vanishes if I call the exe from an existing commandline. ![Offset](https://i.imgur.com/EJTG5LQ.png)
Author
Owner

@glycerine commented on GitHub (Mar 10, 2018):

I can repro this in the windows 10 cmd.exe (cmd.exe is a piece of c**p which ms has never cared about). But it works fine in ConEmu, an actual terminal emulator for windows. https://conemu.github.io/

<!-- gh-comment-id:372028661 --> @glycerine commented on GitHub (Mar 10, 2018): I can repro this in the windows 10 cmd.exe (cmd.exe is a piece of c**p which ms has never cared about). But it works fine in ConEmu, an actual terminal emulator for windows. https://conemu.github.io/
Author
Owner

@jopbrown commented on GitHub (Mar 11, 2018):

The layout may break in certain code page and font .
You can fix it by changing the code page to utf-8 (chcp 65001) and set the font to Consolas.

<!-- gh-comment-id:372121484 --> @jopbrown commented on GitHub (Mar 11, 2018): The layout may break in certain code page and font . You can fix it by changing the code page to utf-8 (`chcp 65001`) and set the font to `Consolas`.
Author
Owner

@glycerine commented on GitHub (Mar 11, 2018):

changing the code page to utf-8 (chcp 65001)

Be very careful with that. Test on a box you have backed up/can wipe and reload the OS. Quoting

https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8

Changing HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\OEMCP value to 65001 appear to make the system unable to boot in my case.

Proposed change of HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun to @chcp 65001>nul served just well for my purpose. (thanks to Ole_Brun)

and

The Windows console is riddled with bugs when the encoding is set to an unsupported multi-byte code page like 65001. Any software using the output counts of the Win32 WriteFile/ReadFile APIs will get the wrong results and consequently stuff build on that like the MSVCRT's implementation of the stdlib will produce mangled/repeated output and hang on input when confronted with non-ASCII. Until MS get around to fixing it — and it has been decades with no sign of that happening — globally changing console code page to 65001 is an extraordinarily bad idea. – bobince Oct 14 '16 at 8:51

<!-- gh-comment-id:372124977 --> @glycerine commented on GitHub (Mar 11, 2018): > changing the code page to utf-8 (chcp 65001) Be very careful with that. Test on a box you have backed up/can wipe and reload the OS. Quoting https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8 > Changing HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\OEMCP value to 65001 appear to make the system unable to boot in my case. > > Proposed change of HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun to @chcp 65001>nul served just well for my purpose. (thanks to Ole_Brun) and > The Windows console is riddled with bugs when the encoding is set to an unsupported multi-byte code page like 65001. Any software using the output counts of the Win32 WriteFile/ReadFile APIs will get the wrong results and consequently stuff build on that like the MSVCRT's implementation of the stdlib will produce mangled/repeated output and hang on input when confronted with non-ASCII. Until MS get around to fixing it — and it has been decades with no sign of that happening — globally changing console code page to 65001 is an extraordinarily bad idea. – bobince Oct 14 '16 at 8:51
Author
Owner

@rivo commented on GitHub (Mar 14, 2018):

I wasn't able to reproduce this on Win10. I did see the extra column once (using a compiled version of the Box demo). But selecting parts of the screen seemed to indicate that it was an issue with the Terminal window, not tview or tcell. Resizing the window made it go away (at least for a while).

I don't see anything I can do here so I'll close this issue.

<!-- gh-comment-id:373089165 --> @rivo commented on GitHub (Mar 14, 2018): I wasn't able to reproduce this on Win10. I did see the extra column once (using a compiled version of the Box demo). But selecting parts of the screen seemed to indicate that it was an issue with the Terminal window, not `tview` or `tcell`. Resizing the window made it go away (at least for a while). I don't see anything I can do here so I'll close this issue.
Author
Owner

@joegrasse commented on GitHub (Mar 27, 2018):

For others that have this issue, my problem was that I had set the cmd font to a different font. When I switch the font back to Courier New, I didn't have the problem anymore.

<!-- gh-comment-id:376587164 --> @joegrasse commented on GitHub (Mar 27, 2018): For others that have this issue, my problem was that I had set the cmd font to a different font. When I switch the font back to Courier New, I didn't have the problem anymore.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#46
No description provided.