prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.28k stars 715 forks source link

when use promttookit with "mouse_support=True" in linux screen mode #1588

Open leochan007 opened 2 years ago

leochan007 commented 2 years ago

new a Application with mouse_support=True

it shows : 'mouse_modifiers' referenced before assignment

Unhandled exception in event loop: File "/home/ubuntu/tradingroom/miniconda3/lib/python3.8/asyncio/events.py", line 81, in _run self._context.run(self._callback, *self._args) File "/home/ubuntu/tradingroom/miniconda3/lib/python3.8/site-packages/prompt_toolkit/input/vt100.py", line 170, in callback_wrapper callback() File "/home/ubuntu/tradingroom/miniconda3/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 712, in read_from_input self.key_processor.process_keys() File "/home/ubuntu/tradingroom/miniconda3/lib/python3.8/site-packages/prompt_toolkit/key_binding/key_processor.py", line 271, in process_keys self._process_coroutine.send(key_press) File "/home/ubuntu/tradingroom/miniconda3/lib/python3.8/site-packages/prompt_toolkit/key_binding/key_processor.py", line 186, in _process self._call_handler(matches[-1], key_sequence=buffer[:]) File "/home/ubuntu/tradingroom/miniconda3/lib/python3.8/site-packages/prompt_toolkit/key_binding/key_processor.py", line 321, in _call_handler handler.call(event) File "/home/ubuntu/tradingroom/miniconda3/lib/python3.8/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 124, in call result = self.handler(event) File "/home/ubuntu/tradingroom/miniconda3/lib/python3.8/site-packages/prompt_toolkit/keybinding/bindings/mouse.py", line 279, in modifiers=mouse_modifiers,

Exception local variable 'mouse_modifiers' referenced before assignment

jonathanslenders commented 2 years ago

This one was fixed recently: https://github.com/prompt-toolkit/python-prompt-toolkit/pull/1574 (It's not yet released to PyPI.)