wsl ncurses programming bug, caused by incompatible terminfo #350

Closed
opened 2026-01-30 21:49:40 +00:00 by claunia · 4 comments
Owner

Originally created by @fantasiajo on GitHub (Aug 22, 2018).

Originally assigned to: @zadjii-msft on GitHub.

I am learning ncurses on wsl. I wrote a simple program, but it isn't rendered correctly.

#include <ncurses.h>

int main(){
    initscr();
    box(stdscr,0,0);
    wborder(stdscr,'|','|','-','-','+','+','+','+');
    refresh();
    getch();
    endwin();
    return 0;
}

My run result is this:
winborderbug
Then I run it in a real debian machine and it is rendered correctly.
Then I ssh to wsl using putty and run this code while setting putty's terminfo into putty-256color, the result is correct like this:
putty

So I think it is because of incompatible terminfo of wsl.

My TERM env is: xterm.

Windows Version: 1803 17134

Originally created by @fantasiajo on GitHub (Aug 22, 2018). Originally assigned to: @zadjii-msft on GitHub. I am learning ncurses on wsl. I wrote a simple program, but it isn't rendered correctly. ```c #include <ncurses.h> int main(){ initscr(); box(stdscr,0,0); wborder(stdscr,'|','|','-','-','+','+','+','+'); refresh(); getch(); endwin(); return 0; } ``` My run result is this: ![winborderbug](https://user-images.githubusercontent.com/13825949/44461117-3ca07080-a642-11e8-9f3c-d7d79f2b57e4.jpg) Then I run it in a real debian machine and it is rendered correctly. Then I ssh to wsl using putty and run this code while setting putty's terminfo into **putty-256color**, the result is correct like this: ![putty](https://user-images.githubusercontent.com/13825949/44461370-247d2100-a643-11e8-8e0d-e296475b521f.JPG) So I think it is because of incompatible terminfo of wsl. My TERM env is: **xterm**. Windows Version: 1803 17134
claunia added the Issue-FeatureProduct-ConhostResolution-Fix-Available labels 2026-01-30 21:49:40 +00:00
Author
Owner

@DHowett commented on GitHub (Aug 22, 2018):

This is probably MSFT:18318890; we don’t support CSI b (repeat graphic character) right now, which the xterm-256color terminfo fairly recently changed to include.

@DHowett commented on GitHub (Aug 22, 2018): This is probably MSFT:18318890; we don’t support CSI b (repeat graphic character) right now, which the xterm-256color terminfo fairly recently changed to include.
Author
Owner

@zadjii-msft commented on GitHub (Aug 22, 2018):

I concur with @DHowett, I'll put this on my backlog, hopefully I'll get to it next month-ish

@zadjii-msft commented on GitHub (Aug 22, 2018): I concur with @DHowett, I'll put this on my backlog, hopefully I'll get to it next month-ish
Author
Owner

@zadjii-msft commented on GitHub (Sep 28, 2018):

I believe the fix for this was checked in yesterday :)

image

@zadjii-msft commented on GitHub (Sep 28, 2018): I believe the fix for this was checked in yesterday :) ![image](https://user-images.githubusercontent.com/18356694/46221703-05894300-c303-11e8-95b2-56b2c1c87322.png)
Author
Owner

@TheJare commented on GitHub (Jan 1, 2019):

In case others run into this, I may suggest making a user-specific terminfo with the problem sequence removed, like:

infocmp | sed 's/\(\s\+\)rep=[^,]*,\s*/\1/' | tic - -o ~/.terminfo/

@TheJare commented on GitHub (Jan 1, 2019): In case others run into this, I may suggest making a user-specific terminfo with the problem sequence removed, like: `infocmp | sed 's/\(\s\+\)rep=[^,]*,\s*/\1/' | tic - -o ~/.terminfo/`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#350