Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Newsbeuter looks wrong after resizing the terminal #492

Closed
Minoru opened this issue Feb 4, 2017 · 10 comments
Closed

Newsbeuter looks wrong after resizing the terminal #492

Minoru opened this issue Feb 4, 2017 · 10 comments

Comments

@Minoru
Copy link
Collaborator

Minoru commented Feb 4, 2017

(Originally reported in comments to another issue).

Newsbeuter version (copy from newsbeuter -v): 2.9-3 (Ubuntu 16.04)

Steps to reproduce the issue:

  1. Start Newsbeuter: screenshot at 2017-02-04 13-01-36

  2. Resize the window: screenshot at 2017-02-04 13-02-12

  3. Resize the window back to the original size: screenshot at 2017-02-04 13-02-51

Other info you think is relevant:

  • the user is using Gnome Terminal and i3 window manager;
  • the user is using Fish shell;
  • TERM is xterm-256color, but Newsbeuter renders slowly if user doesn't have export TERM=xterm-256color in his shell's config. (Yes, this is just re-defining the default.)
@Minoru
Copy link
Collaborator Author

Minoru commented Feb 4, 2017

I find it interesting that the first screenshot doesn't display the hints line at the bottom. Do you have show-keymap-hint set to no?

Wrapping lines is unusual. Do you have your terminal configured to do that?

I retract my earlier statement about i3 being unrelated; maybe it resizes the terminal in such a way that the terminal doesn't notice it properly (still highly doubtful of that, though). Does the bug persist if you resize the terminal using the mouse?

Also, the screen seems to not resize when changed. […] I have to manually go through each of the lists to refresh the output.

What do you mean by "each of the lists" here? There's just one list at a time, and if you go to another dialog, it should be rendered properly.

Does Ctrl-L fix the problem?

(Very confusing. Trying all the questions I can think of.)

@nabsiddiqui
Copy link

nabsiddiqui commented Feb 4, 2017

Sorry for hijacking the other thread. I just thought the two issues were related so I didn't want to open up more issues.

I meant to say that I have to manually highlight each of the articles in a feed to get them to take the window size into consideration. Yes, CTRL-L fixes the issue.

I can also confirm that this problem continues on Mate-Terminal, with bash(my bash config is basically empty), and with the MATE desktop when resizing with the mouse. Here are screenshots of what I am getting:

Original:
screenshot at 2017-02-04 13-53-31

Resized:
screenshot at 2017-02-04 13-54-37

Going back to Original:
screenshot at 2017-02-04 13-54-57

The following is my newsbeuter config:

browser "w3m %u'" 
download-timeout 10
refresh-on-startup yes
reload-threads 50
reload-only-visible-feeds no
bind-key w open-in-browser-and-mark-read
bind-key o open-in-browser
bind-key l open
bind-key h quit
bind-key j next
bind-key k prev
bind-key j down article
bind-key k up article
bind-key a mark-feed-read
bind-key m mark-feed-read
bind-key f toggle-show-read-feeds
show-read-articles no
show-read-feeds no
bind-key p mark-feed-read

@Minoru
Copy link
Collaborator Author

Minoru commented Feb 5, 2017

Okay, so the problem probably isn't in the terminal emulator and/or window manager.

What about Ncurses? What version do you have? Did you build it yourself, installed from third-party repo, or anything like that? Also please post the output of newsbeuter -v.

Do you have similar problems with any other TUIs? Mutt, for example? (Not Irssi—it doesn't use Ncurses.)

@nabsiddiqui
Copy link

This is the output of newsbeuter -v:

newsbeuter 2.9 - http://www.newsbeuter.org/
Copyright (C) 2006-2010 Andreas Krennmair

newsbeuter is free software and licensed under the MIT/X Consortium License.
Type `newsbeuter -vv' for more information.

Compilation date/time: Apr  3 2016 07:12:50
System: Linux 4.4.0-62-generic (x86_64)
Compiler: g++ 5.3.1 20160330
ncurses: ncurses 6.0.20160213 (compiled with 6.0)
libcurl: libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3 (compiled with 7.47.0)
SQLite: 3.11.0 (compiled with 3.11.0)
libxml2: compiled with 2.9.3

I took a longer look at this yesterday, and I think this is the way that the output is supposed to look. If I open a terminal window that takes up half the screen and I then open it up to be the full screen, the output will not extend beyond the original half screen of the terminal. I have the same issue in other ncurses applications like RTV. If this is not the correct behavior, we can keep this open and narrow it down. If not, you may close this.

@Minoru
Copy link
Collaborator Author

Minoru commented Feb 7, 2017

No, this is definitely not a correct behaviour. When you resize the window, Newsbeuter should attempt to use all the space in it. If there's not enough room, some of the content will be "clipped" (but not line-wrapped). When you resize again, the "clipping" won't stick—Newsbeuter should re-draw everything to use the space. That's how it works for me here on NixOS and also what I've seen on Ubuntu 16.04 machine I borrowed to test this.

So let's narrow it down further. Please answer the rest of my questions:

What about Ncurses? What version do you have? Did you build it yourself, installed from third-party repo, or anything like that?

@nabsiddiqui
Copy link

I haven't built ncurses myself or installed from a third party repo. If I run, ncurses5-config --version, I get:

6.0.20160213

I should also note that I am on Ubuntu MATE 16.04(I run a lot of the MATE applications in i3). This shouldn't really make a difference since it uses the base LTS packages and only installs the MATE Desktop on top. I also do not use mate-terminal because I find it has glitches that gnome-terminal does not. Perhaps you may know something that I do not regarding if this makes a difference.

@Minoru
Copy link
Collaborator Author

Minoru commented Feb 7, 2017

I now feel foolish for asking about the version—it's right there in the output of newsbeuter -v. The rest of the details are valuable, though.

I should also note that I am on Ubuntu MATE 16.04

I don't know how much difference this makes, but it's still nice to know. For one, this means that the environment I used for tests (vanilla Ubuntu) might be not as close to yours as I thought.

I also don't know what else you can do to debug it further. It doesn't seem like Newsbeuter itself is broken—otherwise a lot more users will be telling me about the problem. But then your configuration doesn't seem to be very suspicious either—you're running the same Ncurses that tons of Ubuntu users are running, and they don't complain either.

@nabsiddiqui
Copy link

nabsiddiqui commented Feb 9, 2017

Thank you for all your help in this. I reinstalled all the packages, and I found the problem. I haven't keyed in on the exact issue, but it seemed to be a problem with fish shell. I reinstalled an older version of it, and the problem seems to be fixed.

You can close this issue.

@Minoru
Copy link
Collaborator Author

Minoru commented Feb 10, 2017

Hmm, I wonder why it didn't work in Bash either, though. Did Fish mess up something that all shells use? This'll probably stay a mystery forever. :)

@Minoru Minoru closed this as completed Feb 10, 2017
@nabsiddiqui
Copy link

Something must have changed with the latest version of fish that caused this error. While I was testing bash, I simply loaded up bash but the underlying shell was still fish. I thought I had just launched fish through bashrc, but I think when I first installed it I must have set the default terminal to fish, which I didn't remember. I only found this out when I loaded up a virtual machine to test this.

I ended up placing bash back as the default and then launching fish as a launch command through gnome terminal and it fixed this. Moral of the story: don't use fish shell as your default terminal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants