very strange keyboard/chars behavior in nano editor from terminal

5

1

I use "nano" to edit my files on remote servers. I'm on MAC OSX.

When I type characters to nano from time to time it just doesn't enter characters as I type them. The behavior is very strange and hard to describe.

It looks like it overwrites characters and even deletes them instead of inserting new chars. And when I finally save the file and reopen it doesn't show content that I typed before saving.

Seems that it does something that is invisible in editor.

chubbyk

Posted 2011-10-07T17:49:34.967

Reputation: 587

For the first part, are you sure you didn't press the insert button equivalent? – AndrejaKo – 2011-10-07T17:53:33.150

Are you using screen or another terminal emulator and are pressing one of its shortcuts e.g. for selecting from the screen buffer? – Daniel Beck – 2011-10-07T17:54:52.287

I tried it with just pressing e.g the "d" key only. I do not use any emulator. I use standard MAC OSX terminal window – chubbyk – 2011-10-07T18:10:45.527

Answers

1

Try

 TERM=xterm nano filename

in case the value of TERM on the server is incorrect.

RedGrittyBrick

Posted 2011-10-07T17:49:34.967

Reputation: 70 632

that doesn't seem to resolve this issue for me – DDdW – 2016-07-30T09:54:47.107

0

I recall nano having some problems with certain UTF-8 characters. It was reported to their bugtracker a couple of years ago. I cannot find this right now, so I assume the bug has been fixed.

Make sure you have the newest version of nano, and have configured it with --enable-utf8.

egmont

Posted 2011-10-07T17:49:34.967

Reputation: 1 791

0

I have this kind of issue when using serial connections using TeraTerm. Did consider using (temporarily) another communication protocol such as telnet, or another communication software?

Doezer

Posted 2011-10-07T17:49:34.967

Reputation: 431

The site's Q&A format reserves answers for solutions to the question. A comment can be used to request clarifying information or suggest speculative things to try. With a bit more rep, you will be able to post comments.

– fixer1234 – 2016-08-03T17:11:12.727

Thank you, I knew that of course, but as I thought my questions to be pertinent nonetheless, I resorted to doing it anyway. – Doezer – 2016-08-03T18:22:19.383

0

For some reason there is a strange behaviour of nano in combination with macos. The internal cursor position is getting out of sync with what is shown.

Try

export TERM=xterm-color

before starting nano and see if it works, then you can put it in your .bashrc

Alim Özdemir

Posted 2011-10-07T17:49:34.967

Reputation: 111

0

Wow, I just ran into this problem 8 years from your post. I was using the Mojave default nano (2.0.6).

I was trying to use the ⚡ character. https://unicode.org/emoji/charts/full-emoji-list.html#26a1

  ~ 08:30$ nano --version
GNU nano version 2.0.6 (compiled 17:24:36, Aug 17 2018)
Email: nano@nano-editor.org Web: http://www.nano-editor.org/
Compiled options: --disable-nls --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8

enable-utf8 is enabled from the factory.

I just tried GNU nano 4.0 from homebrew, and it doesn't work either. :) You can paste the character blind, save and it will work though. cat has no trouble displaying it.

JP Duffy

Posted 2011-10-07T17:49:34.967

Reputation: 131