Drawing glitches in nano

This might seem like an odd question, but if you have a Ryzen 9xxx series CPU, please let me know, as I might need you to try out a few things in order to find out what causes a bug.

I’ve noticed some redraw artifacts both under Linux and under Haiku; I suspect that there might be issues with the driver (especially if the Haiku GPU driver is insipired by code from Linux).

I need to do further testing on another machine before I post instructions on what to test, but basically it would be something like …

  1. Use the on-chip GPU, not a PCIe graphics card.
  2. Open up the Haiku Terminal.
  3. Set font size to 18pt.
  4. Open up a copy of some 100+ line C-”ish”-source code (I’ll provide a test file later) using tab-size 4.
  5. nano -T sometestfile.c
  6. Press w then press

Bug: The caret should jump backwards (horizontally only) to right after the ‘S’ in “Search”.

This is not so bad in itself, but there are other artifact/redraw problems, which are harder to reproduce. This is likely related.

The actual problem I have, is that bogus-characters appear while I’m editing my C-source files; and on some occasions, the caret either jumps a few characters forward or backward; this makes it difficult to use the editor. I do believe there’s nothing wrong with nano itself, though. It may be the ncurses library, the Terminal or the graphics driver.

(Though the above does not happen for me under Linux, sometimes under debian (XFCE) → Terminal → nano, I see lines not being properly redrawn; I see two gradient-filled triangles the size of a line in the terminal - this is why I suspect the error to be a GPU/driver-related one).

I’ll try the above on a Ryzen 5600g soon, just to see if it’s related to the 9xxx series or if it may be reproducible on other variants.

1 Like

I’ve seen nano have redrawing issues when using it to write commit messages, even when using a GT1030, or under VBox, or VMware. (sometimes it shows the first line of the previous commit message, or fails to “draw” what I type in the first line, until I resize the Terminal window).

Also, Haiku’s radeon_hd driver doesn’t currently supports the iGPU on any modern APU, so… you more than likely are using the “framebuffer” driver (or VESA if not using UEFI boot). So this is not CPU/GPU specific (on Haiku, at least).

2 Likes

Oh, of course, I forgot. Thanks for reminding me - this will likely help finding out what’s actually going wrong. :smiley:

-The issues you mention, are they all under Haiku (eg. none under Linux ?)

Update:

I’ve tested on a Ryzen 5 5600G, the issue also exists there.

On Haiku, yes. I don’t use Linux too often, and don’t even remember using nano there :slight_smile: .

1 Like

OK, then - I think it’s likely that the problem might be in ncurses, especially because I see other style redraw-issues under Linux (not as confusing as those under Haiku).

It might just be something that needs “fine-tuning” in ncurses - perhaps something that gave build-errors and then were fixed in the most sensible way at the time.

-Periodic errors are the worst to find, but most of the time, they have to do with uninitialized variables, but maybe not in this case.

Another thing to consider… Issue might also be with Haiku’s Terminal handling of “escape sequences”.

You could try testing nano using a different Terminal app, like Konsole, for example (I haven’t done so yey, because I try to stay away of larger dependency chains, Qt on this case).

Edit: recategorized the post and changed title, because this doesn’t seems hardware related.

1 Like

:slight_smile: - the same here, I never liked Qt, it ruined an application my team was working on (after I left the company many years ago; my team made it a native Cocoa application on Mac OS X, then those who took over from us replaced Cocoa by Qt and the app was sluggish, ugly and felt incorrect to use, so I never used that version of it).

You’re giving me such good suggestions. Thank you. :slight_smile:

Just thought of one more thing…

When I (from Haiku Terminal) ssh into my Raspberry Pi 4B, the nano there does not cause the glitches I see with the local nano on Haiku.

-Thus, I very much believe it’s not the Terminal that has problems (still I could be wrong).