rougier / agenda

Org agenda in the console
GNU General Public License v3.0
133 stars 9 forks source link

Exception outside screen #4

Open danielfleischer opened 3 years ago

danielfleischer commented 3 years ago

When the window is bigger than the graphics, I get an exception:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 4: invalid start byte

when cursor goes to the right side, outside the region of the calendar.

rougier commented 3 years ago

What do you mean window bigger than the graphics ? When agenda is trying to write beyond terminal? If so, I think it needs some test to check whether we're outside the printable area.

danielfleischer commented 3 years ago

The window width is wider than the calendar and when the mouse wonders to the empty space on the right there's an exception. I tested it with 2 terminal applications (Mac built-in and iTerm2).

rougier commented 3 years ago

Got it! And I confirm I got the same behavior. I'll try to make a fix.

rougier commented 3 years ago

It seems there are some limit in the x direction which shoudl be < 95 (just run the terminal.py file to chekc). but I cannot find the relevant documentation to know where this lmimit comes from.

rougier commented 3 years ago

So in the end I should use SGR 1006 protocol (https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#Mouse%20Tracking) to avoid any problem.