michael-lazar / rtv

Browse Reddit from your terminal
MIT License
4.64k stars 273 forks source link

Crash when resizing terminal #677

Open BrianAllred opened 5 years ago

BrianAllred commented 5 years ago

I had rtv open in gnome-terminal and hit maximize. rtv then crashed with the following:

rtv version: rtv 1.26.0
rtv module path: /usr/lib/python3.7/site-packages/rtv/__main__.py
python version: 3.7.3 (default, Mar 26 2019, 21:43:19)  [GCC 8.2.1 20181127]
python executable: /usr/bin/python
praw version: packaged, commit 1656ec224e57
locale, encoding: en_US.UTF-8, UTF-8
Environment Variables
  BROWSER         : 
  DISPLAY         : :0
  EDITOR          : 
  LANG            : en_US.UTF-8
  PAGER           : 
  RTV_BROWSER     : 
  RTV_EDITOR      : 
  RTV_PAGER       : 
  RTV_URLVIEWER   : 
  TERM            : xterm-256color
  VISUAL          : 
  XDG_CONFIG_HOME : 
  XDG_DATA_HOME   : 

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/rtv/__main__.py", line 255, in main
    page = page.loop()
  File "/usr/lib/python3.7/site-packages/rtv/page.py", line 92, in loop
    self.draw()
  File "/usr/lib/python3.7/site-packages/rtv/page.py", line 663, in draw
    self._draw_content()
  File "/usr/lib/python3.7/site-packages/rtv/page.py", line 805, in _draw_content
    subwindow = window.derwin(subwin_n_rows, subwin_n_cols, start, data['h_offset'])
_curses.error: curses function returned NULL

rtv has crashed. Please report this traceback at:
https://github.com/michael-lazar/rtv/issues

Environment is Arch Linux and Gnome Terminal 3.32.1-1.

michael-lazar commented 5 years ago

Thanks for the bug report. Is this reproducible or was it a random one-time error?

BrianAllred commented 5 years ago

I can reproduce it when rtv is started and the terminal starts windowed and is then maximized. Starting rtv with the terminal maximized, I can go back and forth with no issue.

pomegr4nate commented 4 years ago

I have the same problem in Gnome Terminal 3.36.0.1 on Arch Linux

rtv version: rtv 1.27.0
rtv module path: /usr/lib/python3.8/site-packages/rtv/__main__.py
python version: 3.8.2 (default, Feb 26 2020, 22:21:03)  [GCC 9.2.1 20200130]
python executable: /usr/bin/python
praw version: packaged, commit 1656ec224e57
locale, encoding: en_GB.UTF-8, UTF-8
Environment Variables
  BROWSER         : 
  DISPLAY         : :0
  EDITOR          : vim
  LANG            : en_GB.UTF-8
  PAGER           : less
  RTV_BROWSER     : 
  RTV_EDITOR      : 
  RTV_PAGER       : 
  RTV_URLVIEWER   : 
  TERM            : xterm-256color
  VISUAL          : 
  XDG_CONFIG_HOME : 
  XDG_DATA_HOME   : 

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/rtv/__main__.py", line 255, in main
    page = page.loop()
  File "/usr/lib/python3.8/site-packages/rtv/page.py", line 92, in loop
    self.draw()
  File "/usr/lib/python3.8/site-packages/rtv/page.py", line 663, in draw
    self._draw_content()
  File "/usr/lib/python3.8/site-packages/rtv/page.py", line 805, in _draw_content
    subwindow = window.derwin(subwin_n_rows, subwin_n_cols, start, data['h_offset'])
_curses.error: curses function returned NULL