richrd / suplemon

:lemon: Console (CLI) text editor with multi cursor support. Suplemon replicates Sublime Text like functionality in the terminal. Try it out, give feedback, fork it!
MIT License
788 stars 43 forks source link

Exception: 'NoneType' object has no attribute 'getmaxyx' #269

Open pJunger opened 3 years ago

pJunger commented 3 years ago

Hey,

I've encountered this exception after doing the following on the master branch (8bb67d6758e5bc5ca200fdce7a0fb6635abb66f4):

  1. Open a file
  2. Press Enter
  3. Exiting via Ctrl + q

That lead to the following output:

Traceback (most recent call last):
  File "/usr/local/bin/suplemon", line 11, in <module>
    load_entry_point('Suplemon==0.2.1', 'console_scripts', 'suplemon')()
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/cli.py", line 37, in main
    app.run()
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/main.py", line 132, in run
    self.ui.run(self.run_wrapped)
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/ui.py", line 142, in run
    curses.wrapper(func)
  File "/usr/lib/python3.8/curses/__init__.py", line 105, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/main.py", line 148, in run_wrapped
    self.main_loop()
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/main.py", line 201, in main_loop
    self.on_input(event)  # PERF: Up to 30% processing time
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/main.py", line 173, in on_input
    if not self.handle_input(event):
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/main.py", line 301, in handle_input
    return self.handle_key(event)
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/main.py", line 322, in handle_key
    self.run_operation(operation)
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/main.py", line 506, in run_operation
    result = self.operations[operation]()
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/main.py", line 389, in ask_exit
    yes = self.ui.query_bool("Exit?")
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/ui.py", line 539, in query_bool
    result = self._query(text, default, PromptBool)
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/ui.py", line 525, in _query
    out = self.text_input.get_input(text, initial)
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/prompt.py", line 129, in get_input
    self.end()  # Move to the end of the initial text
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/viewer.py", line 738, in end
    self.move_cursors()
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/viewer.py", line 578, in move_cursors
    size = self.get_size()
  File "/usr/local/lib/python3.8/dist-packages/Suplemon-0.2.1-py3.8.egg/suplemon/viewer.py", line 104, in get_size
    y, x = self.window.getmaxyx()
AttributeError: 'NoneType' object has no attribute 'getmaxyx'