Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #200673

Re: ncurses problem

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: ncurses problem
Date 2018-09-27 15:00 +0200
Message-ID <wCE3E-3sh-11@gated-at.bofh.it> (permalink)
References <wCoLg-2Ur-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Sep 26, 2018 at 10:38:53PM +0000, Grzesiek Sójka wrote:
> Hi there,
> 
> I compiled following test program:
> ==========================================
> #include <ncurses.h>
> #include <string.h>
[snip]

> It's supposed to show current window dimension when resizing terminal
> window. Unfortunately, dimensions are not updated and it shows initial
> geometry. Interesting thing is that it works perfectly after "ssh localhost"
> or "su -". I tested on both, sid and stretch. exactly the same result.
> 
> Any ideas??

My first thought is that your shell login profile,

> PS. I use xfce4 and lxdm.

... which is NOT how you normally log in, is turning on bash's
checkwinsize option, which causes bash to set the LINES and COLUMNS
variables upon receipt of a SIGWINCH (a signal that is sent when the
window changes size).

In the absence of that option, those variables might not be set at all,
or might be set to the wrong size, and won't be updated when the window
changes size while sitting in an idle shell.

(What an ncurses program does with this signal, I honestly do not know.)

So, just wild-ass guessing here, you might have put the necessaray
"shopt -s checkwinsize" and "export LINES COLUMNS" into ~/.profile
which is only read when you perform a shell login, and NOT when you
perform an lxdm login.  That's why something might "work" when you
first do "ssh localhost" to get a shell login environment.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

ncurses problem Grzesiek Sójka <pld@sojka.co> - 2018-09-26 22:40 +0200
  Re: ncurses problem Greg Wooledge <wooledg@eeg.ccf.org> - 2018-09-27 15:00 +0200
    Re: ncurses problem Sven Joachim <svenjoac@gmx.de> - 2018-09-28 11:50 +0200
      Re: ncurses problem Grzesiek Sójka <pld@sojka.co> - 2018-09-29 11:10 +0200
        Re: ncurses problem Sven Joachim <svenjoac@gmx.de> - 2018-09-29 11:20 +0200
          Re: ncurses problem Grzesiek Sójka <pld@sojka.co> - 2018-09-29 11:30 +0200

csiph-web