The problem is that I’m not sure if this is a Kakoune issue or not. Maybe my terminal emulator is optimizing kak in weird ways? Should I raise it anyways? I did raise a feature request to help fix this issue I’m seeing.
This is almost certainly a mismatch between the terminal emulator you are running and the terminal emulator Kakoune thinks you’re running.
All terminal emulators support basic things like moving the cursor to a particular location on-screen, changing color, and drawing text, and that’s enough to get an app like Kakoune working… but in practice, it’s frustratingly slow. Different terminals support different extensions that can describe screen updates more efficiently (like scrolling a region of the screen, or clearing a region to a particular colour, or run-length compression of the text stream), and Kakoune (at least in the current master branch that uses ncurses) depends on the $TERM environment variable to tell it what specific terminal emulator you’re using, so it can adapt itself to the extensions that terminal provides.
You should also be aware that the problem comes in two halves - your terminal emulator running on your system sets $TERM to some value, but the value is interpreted on the system where the application runs. So the same terminal emulator with the same $TERM value can work beautifully on one system and be broken on another, if those systems have different terminal-definition databases.
That’s interesting. When I detach from tmux then the visual bug almost disappears entirely. (I can mash Ctrl-U and Ctrl-D to sometimes get to to reproduce, but before it would almost always break.)
This complicates things. It sounds like I can do some trial and error to figure out which $TERM value I should use for different machines I work on though. Thanks!