Score:2

My nano editor can't read tags?

nl flag

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

Paul avatar
us flag
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.
quang duy avatar
nl flag
@Paul When i add comment it show up https://ibb.co/rm83v7P
Paul avatar
us flag
Have you configured anything in `/etc/nanorc` or `~/.nanorc`?
quang duy avatar
nl flag
No, i didn't config any thing in there
j0h avatar
au flag
j0h
re-installation sounds extreme, given the huge number of other text editing software you could install and use. Is this a Windows Linux Subsystem?
quang duy avatar
nl flag
@j0h yes i use wsl version 2
quang duy avatar
nl flag
vim can't read that too ;(
j0h avatar
au flag
j0h
I suspect WLS is missing the proper fonts or has something that bash cant display properly. what font is bash using? I havent used WLS, but I imagine its probably a right click properties, then goto fonts or something like that. you might need to install fonts.
quang duy avatar
nl flag
I dont think its font 's problem because .json file and .js working well and file using tag <> like xml and html got error
Artur Meinild avatar
vn flag
Can you please copy and paste the contents directly from the editor? I suspect it's a color issue, where its black text on black background.
quang duy avatar
nl flag
@ArturMeinild OH you 're right it has the same color with background, but how to fix this
Score:1
vn flag

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.

quang duy avatar
nl flag
Fixed, Many Thanks! you 're so brilliant
Artur Meinild avatar
vn flag
I'm happy it worked out for you. Cheers!
us flag
you can start nano with no syntax highlighting or colouring by using `nano -Ynone [whatever]`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.