Nano editor in bash - display problem

terminal
editor

#1

I have a display problem with the nano editor.

When the text gets longer than the screen height (so I would have to “scroll” to see different parts of the text), I get a display bug.

When I first fire up nano, my screen looks normal. But when I move the cursor to the bottom of the file, the following happens

As you can see the display is all over the place (my text has 7 exercises and exercise 4 and 5 get “swallowed”). Also my cursor is in the last possible position (marked with a red circle), yet some text shows up after it.

What I found out so far: It is only a display error, the code in my file does not get affected by it. I can even type normally ignoring the whole display error and the code turns out to be fine (if I look at the file’s content with command cat from bash). So this is either a display bug or something is not working in my browser. I use Firefox 50.1.0.

See below for the text I used in the nano editor. Note that I had the same problem previously with a completely different text so the actual text is irrelevant. Also the same problem happened with a normal .txt file so this is not a ruby specific problem. The relevant factor is the text length of the file.


# Exercise 1
puts "1) My " + "Name"
puts “”

# Exercise 2
puts "2) We have the number 5678"
puts "thousands: " + (5678 / 1000).to_s
puts "hundreds: " + (5678 / 100 % 10).to_s
puts "tens: " + (5678 % 100 / 10).to_s
puts "ones: " + (5678 % 10).to_s
puts “”

# Exercise 3
puts "3)"
films = {:titanic => 1997, :scarface => 1984, :avatar => 2008}
puts films[:titanic]
puts films[:scarface]
puts films[:avatar]
puts “”

# Exercise 4
puts "4)"
years = [films[:titanic], films[:scarface], films[:avatar]]
puts years
puts “”

# Exercise 5
puts "5)"
puts "Factorial of 5: " + (5 * 4 * 3 * 2 * 1).to_s
puts "Factorial of 6: " + (6 * 5 * 4 * 3 * 2 * 1).to_s
puts "Factorial of 7: " + (7 * 6 * 5 * 4 * 3 * 2 * 1).to_s
puts "Factorial of 8: " + (8 * 7 * 6 * 5 * 4 * 3 * 2 * 1).to_s
puts “”

# Exercise 6
puts "6) "
puts "The square of 10.2 is " + (10.2 * 10.2).to_s
puts "The square of 5.55 is " + (5.55 * 5.55).to_s
puts "The square of 0.11 is " + (0.11 * 0.11).to_s
puts “”

# Exercise 7
puts "7) "
puts "There is a closing parentheses on line 16 in the code but the compiler expected a closing curly bracket. That means an opened curly bracket was not closed


#2

see