You are not logged in.

#1 2017-09-27 19:43:52

erovborabva
Member
Registered: 2017-09-22
Posts: 18

[SOLVED] Ncurses not displaying border correctly in gnome-terminal

I am learning how to use ncurses, and I have noticed that for some reason, in gnome-terminal (on arch) ncurses window borders are not being displayed properly. It seems to work fine in xterm.
https://ptpb.pw/03b6.png
https://ptpb.pw/jW2C.png

Not sure what could be causing this, and I haven't had any luck googling. Any ideas?

Last edited by erovborabva (2017-09-27 20:05:05)

Offline

#2 2017-09-27 19:49:15

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

Read the Code of Conduct and only post thumbnails http://wiki.archlinux.org/index.php/Cod … s_and_code

Are you setting $TERM anywhere?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-09-27 19:53:46

erovborabva
Member
Registered: 2017-09-22
Posts: 18

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

jasonwryan wrote:

Read the Code of Conduct and only post thumbnails http://wiki.archlinux.org/index.php/Cod … s_and_code

Are you setting $TERM anywhere?

Sorry, fixed links. My $TERM is set to screen.xterm-256color

Offline

#4 2017-09-27 19:57:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,522
Website

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

erovborabva wrote:

$TERM is set to screen.xterm-256color

What on earth is that?  That is not a valid setting.  But the key is you shouldn't be setting TERM at all.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#5 2017-09-27 20:03:16

erovborabva
Member
Registered: 2017-09-22
Posts: 18

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

Trilby wrote:
erovborabva wrote:

$TERM is set to screen.xterm-256color

What on earth is that?  That is not a valid setting.  But the key is you shouldn't be setting TERM at all.

Ah, changing $TERM to "gnome" fixed it. Thanks!

Offline

#6 2017-09-27 20:05:33

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

erovborabva wrote:
Trilby wrote:
erovborabva wrote:

$TERM is set to screen.xterm-256color

What on earth is that?  That is not a valid setting.  But the key is you shouldn't be setting TERM at all.

Ah, changing $TERM to "gnome" fixed it. Thanks!

headesk

No, it didn't "fix" anything. It just shifted the brokeness one space to the right.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2017-09-27 20:16:07

erovborabva
Member
Registered: 2017-09-22
Posts: 18

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

jasonwryan wrote:
erovborabva wrote:
Trilby wrote:

What on earth is that?  That is not a valid setting.  But the key is you shouldn't be setting TERM at all.

Ah, changing $TERM to "gnome" fixed it. Thanks!

headesk

No, it didn't "fix" anything. It just shifted the brokeness one space to the right.

Please explain? Not sure what you mean by that. I did try setting the $TERM variable to empty, but that seems to break things.

Offline

#8 2017-09-27 20:17:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,522
Website

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

Trilby wrote:

But the key is you shouldn't be setting TERM at all.

Not setting TERM is not the same as setting it to an empty string.  Just remove any and all lines in any shell config or simlar file where you have anything like "TERM=...".

You can configure your terminal to use a different TERM setting, but Gnome Terminal's default should be good.  But just the same, configuring the terminal is different than setting what should be a read-only variable from within the shell.

Last edited by Trilby (2017-09-27 20:18:47)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#9 2017-09-27 20:21:17

erovborabva
Member
Registered: 2017-09-22
Posts: 18

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

Trilby wrote:
Trilby wrote:

But the key is you shouldn't be setting TERM at all.

Not setting TERM is not the same as setting it to an empty string.  Just remove any and all lines in any shell config or simlar file where you have anything like "TERM=...".

You can configure your terminal to use a different TERM setting, but Gnome Terminal's default should be good.  But just the same, configuring the terminal is different than setting what should be a read-only variable from within the shell.

I thought I had it set to the default previously. I have never modified the TERM variable in any of my config files, so unless some other program is setting the value I am not sure where I would remove it from.

Offline

#10 2017-09-27 20:36:51

erovborabva
Member
Registered: 2017-09-22
Posts: 18

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

Well as my problem is gone for now I will leave this as solved. I have not found any other config file setting TERM. If someone else has a better solution please feel free to share. Thanks for the help.

Offline

#11 2017-09-27 21:05:48

seth
Member
Registered: 2012-09-03
Posts: 51,000

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

Online

#12 2017-09-27 21:08:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,522
Website

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

Uh, that's horrible.  Sorry erovborabva, if you're using screen that would explain that very odd setting.  It is still the cause of the problem, but it may not be your fault (unless we can hold it against you that you use screen instead of tmux tongue)

I just installed screen and tried it out with no config, it set TERM just to "screen" not to "screen.$TERM" (there was an existing TERM setting from urxvt).

EDIT: I can replicate the below, but when TERM is urxvt's default (rxvt-unicode-256color), screen just sets it to "screen".

Last edited by Trilby (2017-09-27 23:04:36)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#13 2017-09-27 21:22:10

seth
Member
Registered: 2012-09-03
Posts: 51,000

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

~/.Xresources

URxvt*termName:               xterm-256color
% echo $TERM
xterm-256color
% screen
% echo $TERM
screen.xterm-256color
% exit
% echo $TERM
xterm-256color

*shrug*

Online

#14 2017-09-27 21:42:25

erovborabva
Member
Registered: 2017-09-22
Posts: 18

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

Trilby wrote:

Uh, that's horrible.  Sorry erovborabva, if you're using screen that would explain that very odd setting.  It is still the cause of the problem, but it may not be your fault (unless we can hold it against you that you use screen instead of tmux tongue)

I just installed screen and tried it out with no config, it set TERM just to "screen" not to "screen.$TERM" (there was an existing TERM setting from urxvt).

Yeah I was using screen at the time. Without screen it still defaults to xterm-256color and ncurses is still broken. Oh well, as a temporary fix, 'gnome' seems to work.

Offline

#15 2017-09-27 21:50:04

seth
Member
Registered: 2012-09-03
Posts: 51,000

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

Smells like a bug in gnome-terminal or ncurses. How does gnome-256color behave?

Online

#16 2017-09-27 22:03:58

erovborabva
Member
Registered: 2017-09-22
Posts: 18

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

seth wrote:

Smells like a bug in gnome-terminal or ncurses. How does gnome-256color behave?

gnome-256color seems to work fine as well.

Offline

#17 2017-09-28 06:31:23

templrivanho
Member
Registered: 2015-04-11
Posts: 3

Re: [SOLVED] Ncurses not displaying border correctly in gnome-terminal

It actually looks to be a bug in ncurses with ncurses-6.0+20170527-1 working correctly in the instances I use it for (bmon and wavemon).  Anything after that seems to cause the visual corruption(s).  The $TERM variable has also not been changed.  I'll see about looking further into it tomorrow.

Offline

Board footer

Powered by FluxBB