Logic for scrolling the messages window assumes each message is only one line when calculating the max messages/start index/etc for displaying messages. But we also wrap lines, so we can eventually attempt to draw outside the bounds of the messages window, leading to a crash with "addwstr() returned ERR". This only occurs if there are messages long enough to be wrapped and the chat is long enough to require scrolling the messages window.
Chats with traceroutes are especially likely to contain wrapped lines.
Logic for scrolling the messages window assumes each message is only one line when calculating the max messages/start index/etc for displaying messages. But we also wrap lines, so we can eventually attempt to draw outside the bounds of the messages window, leading to a crash with "addwstr() returned ERR". This only occurs if there are messages long enough to be wrapped and the chat is long enough to require scrolling the messages window.
Chats with traceroutes are especially likely to contain wrapped lines.
<!-- github-sync-id:2796232967 -->
I had to change ui/curses_ui.py to get the msg window to scroll properly. In draw_messages_window() I changed max_messages calc to : max_messages = messages_win.getmaxyx()[0] - 4. Not sure why -4. Also in adjusting the height if log is visible I changed max_messages to just subtract the packetlog_height. max_messages -= packetlog_height. This does not take into account the wrapped messages as explained above. and I use tmux for my terminal session but I don't think it makes a difference. Before these mods once the message screen filled up it would crash...
I had to change ui/curses_ui.py to get the msg window to scroll properly. In draw_messages_window() I changed max_messages calc to : **max_messages = messages_win.getmaxyx()[0] - 4**. Not sure why **-4**. Also in adjusting the height if log is visible I changed max_messages to just subtract the packetlog_height. **max_messages -= packetlog_height**. This does not take into account the wrapped messages as explained above. and I use tmux for my terminal session but I don't think it makes a difference. Before these mods once the message screen filled up it would crash...
<!-- github-comment-id:2605483324 -->
I fixed the above problem by copying the 2 lines that calculate the scoll position to do it again after the dynamic calc based on visible msgs and wraps and it corrected the issue.
I fixed the above problem by copying the 2 lines that calculate the scoll position to do it again after the dynamic calc based on visible msgs and wraps and it corrected the issue.
<!-- github-comment-id:2605563132 -->
I m ay have just gotten lucky with number of wrapped lines working out in #40 There are still issues with drawing messages and scrolling to the bottom of the message list
I m ay have just gotten lucky with number of wrapped lines working out in #40 There are still issues with drawing messages and scrolling to the bottom of the message list
<!-- github-comment-id:2605976868 -->
I think I should be able to get the pad solution into a state where it can be merged in the next couple days, which will fix this and improve the window flashing issue. For a first pass I'm planning to just size the pad so it fits all the messages in the channel and fully refresh it on incoming messages (as we are doing now with the window.) We can further optimize as a follow up.
I think I should be able to get the pad solution into a state where it can be merged in the next couple days, which will fix this and improve the window flashing issue. For a first pass I'm planning to just size the pad so it fits all the messages in the channel and fully refresh it on incoming messages (as we are doing now with the window.) We can further optimize as a follow up.
<!-- github-comment-id:2606135121 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Logic for scrolling the messages window assumes each message is only one line when calculating the max messages/start index/etc for displaying messages. But we also wrap lines, so we can eventually attempt to draw outside the bounds of the messages window, leading to a crash with "addwstr() returned ERR". This only occurs if there are messages long enough to be wrapped and the chat is long enough to require scrolling the messages window.
Chats with traceroutes are especially likely to contain wrapped lines.
I had to change ui/curses_ui.py to get the msg window to scroll properly. In draw_messages_window() I changed max_messages calc to : max_messages = messages_win.getmaxyx()[0] - 4. Not sure why -4. Also in adjusting the height if log is visible I changed max_messages to just subtract the packetlog_height. max_messages -= packetlog_height. This does not take into account the wrapped messages as explained above. and I use tmux for my terminal session but I don't think it makes a difference. Before these mods once the message screen filled up it would crash...
I fixed the above problem by copying the 2 lines that calculate the scoll position to do it again after the dynamic calc based on visible msgs and wraps and it corrected the issue.
I m ay have just gotten lucky with number of wrapped lines working out in #40 There are still issues with drawing messages and scrolling to the bottom of the message list
I think I should be able to get the pad solution into a state where it can be merged in the next couple days, which will fix this and improve the window flashing issue. For a first pass I'm planning to just size the pad so it fits all the messages in the channel and fully refresh it on incoming messages (as we are doing now with the window.) We can further optimize as a follow up.
That sounds wonderful.