4

I have a Python script that writes a log file "temperatures.csv". Following "https://stackoverflow.com/questions/287871/how-to-print-colored-text-to-the-terminal", I added some ANSI escape sequences to highlight text when, for example, a temperature reading is above a specified value. The colored text shows nicely wen viewing the log file with less -R or tail or cat. But if I edit the file using nano, I see the escape sequence but no color: 2021-01-18 19:28, ^[[94mRoomTemp: 66.88^[[0m, StoveTemp: 398.3

Is there a way to get nano to interpret ANSI escape sequences and show text in color? I'm working with Raspbian GNU/Linux 10 Buster and SSH terminals.

user3217032
  • 79
  • 2
  • 5

0 Answers0