I normally use nano edit, however, today when I open it, it didn't show "<>" and character next to it. I have reinstalled Ubuntu and the problem is still there.

In the image below it doesn't show "<role" for example:

Screenshot showing error

I know they are missing because when I add a comment "<role" shows up:

Screenshot showing expected output

  • 1
    How did you verify that <role is supposed to be in the file? Unless you have some custom configurations for nano, it will just display everything in the file.
    – Paul
    Commented Aug 6, 2021 at 13:41
  • @Paul When i add comment it show up ibb.co/rm83v7P
    – quang duy
    Commented Aug 6, 2021 at 14:35
  • Have you configured anything in /etc/nanorc or ~/.nanorc?
    – Paul
    Commented Aug 6, 2021 at 14:40
  • 1
    re-installation sounds extreme, given the huge number of other text editing software you could install and use. Is this a Windows Linux Subsystem?
    – j0h
    Commented Aug 6, 2021 at 23:21
  • 1
    @j0h yes i use wsl version 2
    – quang duy
    Commented Aug 7, 2021 at 2:28

1 Answer 1


Now that we have established that you have black text on black background, I imagine there are 2 possible solutions:

  1. Either it's the color settings in your terminal application
  2. Or a problem with the color settings in your <fileformat>.nanorc files

For 1, you have to explore the settings of your terminal application, and see it the colors are defined in such a way that one of the foreground colors are set to black.

For 2, go to this directory:

cd /usr/share/nano/

Here you will find a number of syntax highlighting files, especially check out html.nanorc and xml.nanorc.

By adjusting these, you should be able to test if you can set different colors, so that it works for you.

Please try the above 2 things, I'm pretty sure at least one of them can fix your issue.

  • 1
    Fixed, Many Thanks! you 're so brilliant
    – quang duy
    Commented Aug 9, 2021 at 8:54
  • 1
    I'm happy it worked out for you. Cheers! Commented Aug 9, 2021 at 8:55
  • you can start nano with no syntax highlighting or colouring by using nano -Ynone [whatever] Commented Oct 26, 2021 at 17:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .