1

I am running MacOS Big Sur 11.7.9. Recently my nano editor stopped displaying text correctly using bash or zsh, and it scrambles text and doesn't properly display text.

How can I debug and fix this error?

Please see attached imgur video for the problem in action.

Things I've tried

  • Run stty sane -> no change
  • Opened a Terminal tab with a different profile -> no change
  • Created a new user account on my Mac -> problem occurs there as well

Running the command

ls  -l /usr/share/terminfo/78/xterm*

returns:

-rw-r--r--  1 root  wheel  3258 Jan  1  2020 /usr/share/terminfo/78/xterm
-rw-r--r--  1 root  wheel  1053 Jan  1  2020 /usr/share/terminfo/78/xterm+256color
-rw-r--r--  1 root  wheel  1051 Jan  1  2020 /usr/share/terminfo/78/xterm+88color
-rw-r--r--  1 root  wheel   422 Jan  1  2020 /usr/share/terminfo/78/xterm+app
-rw-r--r--  1 root  wheel   418 Jan  1  2020 /usr/share/terminfo/78/xterm+edit
-rw-r--r--  1 root  wheel   420 Jan  1  2020 /usr/share/terminfo/78/xterm+noapp
-rw-r--r--  1 root  wheel   404 Jan  1  2020 /usr/share/terminfo/78/xterm+pc+edit
-rw-r--r--  1 root  wheel  1153 Jan  1  2020 /usr/share/terminfo/78/xterm+pcc0
-rw-r--r--  1 root  wheel   824 Jan  1  2020 /usr/share/terminfo/78/xterm+pcc1
-rw-r--r--  1 root  wheel  1205 Jan  1  2020 /usr/share/terminfo/78/xterm+pcc2
-rw-r--r--  1 root  wheel   902 Jan  1  2020 /usr/share/terminfo/78/xterm+pcc3
-rw-r--r--  1 root  wheel  1091 Jan  1  2020 /usr/share/terminfo/78/xterm+pce2
-rw-r--r--  1 root  wheel  1011 Jan  1  2020 /usr/share/terminfo/78/xterm+pcf0
-rw-r--r--  1 root  wheel  1049 Jan  1  2020 /usr/share/terminfo/78/xterm+pcf2
-rw-r--r--  1 root  wheel  2069 Jan  1  2020 /usr/share/terminfo/78/xterm+pcfkeys
-rw-r--r--  1 root  wheel  1094 Jan  1  2020 /usr/share/terminfo/78/xterm+r6f2
-rw-r--r--  1 root  wheel  3268 Jan  1  2020 /usr/share/terminfo/78/xterm+sl
-rw-r--r--  1 root  wheel  3296 Jan  1  2020 /usr/share/terminfo/78/xterm+sl-twm
-rw-r--r--  1 root  wheel   464 Jan  1  2020 /usr/share/terminfo/78/xterm+vt+edit
-rw-r--r--  1 root  wheel  3269 Jan  1  2020 /usr/share/terminfo/78/xterm-1002
-rw-r--r--  1 root  wheel  3269 Jan  1  2020 /usr/share/terminfo/78/xterm-1003
-rw-r--r--  1 root  wheel  3402 Jan  1  2020 /usr/share/terminfo/78/xterm-16color
-rw-r--r--  1 root  wheel  1525 Jan  1  2020 /usr/share/terminfo/78/xterm-24
-rw-r--r--  1 root  wheel  3322 Jan  1  2020 /usr/share/terminfo/78/xterm-256color
-rw-r--r--  1 root  wheel  3320 Jan  1  2020 /usr/share/terminfo/78/xterm-88color
-rw-r--r--  1 root  wheel  1903 Jan  1  2020 /usr/share/terminfo/78/xterm-8bit
-rw-r--r--  1 root  wheel  1799 Jan  1  2020 /usr/share/terminfo/78/xterm-basic
-rw-r--r--  1 root  wheel  1535 Jan  1  2020 /usr/share/terminfo/78/xterm-bold
-rw-r--r--  1 root  wheel  1551 Jan  1  2020 /usr/share/terminfo/78/xterm-color
-rw-r--r--  1 root  wheel  1845 Jan  1  2020 /usr/share/terminfo/78/xterm-hp
-rw-r--r--  1 root  wheel  3252 Jan  1  2020 /usr/share/terminfo/78/xterm-new
-rw-r--r--  1 root  wheel  3268 Jan  1  2020 /usr/share/terminfo/78/xterm-nic
-rw-r--r--  1 root  wheel  3232 Jan  1  2020 /usr/share/terminfo/78/xterm-noapp
-rw-r--r--  1 root  wheel  1501 Jan  1  2020 /usr/share/terminfo/78/xterm-old
-rw-r--r--  1 root  wheel  3324 Jan  1  2020 /usr/share/terminfo/78/xterm-pcolor
-rw-r--r--  1 root  wheel  1301 Jan  1  2020 /usr/share/terminfo/78/xterm-r5
-rw-r--r--  1 root  wheel  1501 Jan  1  2020 /usr/share/terminfo/78/xterm-r6
-rw-r--r--  1 root  wheel  2021 Jan  1  2020 /usr/share/terminfo/78/xterm-sco
-rw-r--r--  1 root  wheel  2105 Jan  1  2020 /usr/share/terminfo/78/xterm-sun
-rw-r--r--  1 root  wheel  1983 Jan  1  2020 /usr/share/terminfo/78/xterm-vt220
-rw-r--r--  1 root  wheel   484 Jan  1  2020 /usr/share/terminfo/78/xterm-vt52
-rw-r--r--  1 root  wheel  2001 Jan  1  2020 /usr/share/terminfo/78/xterm-xf86-v32
-rw-r--r--  1 root  wheel  1991 Jan  1  2020 /usr/share/terminfo/78/xterm-xf86-v33
-rw-r--r--  1 root  wheel  2001 Jan  1  2020 /usr/share/terminfo/78/xterm-xf86-v333
-rw-r--r--  1 root  wheel  2207 Jan  1  2020 /usr/share/terminfo/78/xterm-xf86-v40
-rw-r--r--  1 root  wheel  2221 Jan  1  2020 /usr/share/terminfo/78/xterm-xf86-v43
-rw-r--r--  1 root  wheel  2255 Jan  1  2020 /usr/share/terminfo/78/xterm-xf86-v44
-rw-r--r--  1 root  wheel  2235 Jan  1  2020 /usr/share/terminfo/78/xterm-xfree86
-rw-r--r--  1 root  wheel  1981 Jan  1  2020 /usr/share/terminfo/78/xterm-xi
-rw-r--r--  1 root  wheel  3260 Jan  1  2020 /usr/share/terminfo/78/xterm1
-rw-r--r--  1 root  wheel  1607 Jan  1  2020 /usr/share/terminfo/78/xtermc
-rw-r--r--  1 root  wheel  1440 Jan  1  2020 /usr/share/terminfo/78/xtermm
-rw-r--r--  1 root  wheel  1525 Jan  1  2020 /usr/share/terminfo/78/xterms
-rw-r--r--  1 root  wheel  2121 Jan  1  2020 /usr/share/terminfo/78/xterms-sun

My $PATH is:

/usr/local/opt/curl/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/[email protected]/bin:/Users/danran/.local/bin:/Users/danran/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/dfsee/mac/:/usr/local/etc/pki
25
  • 1
    Start by uninstalling OMZ. So many issues get solved by removing it.
    – Allan
    Jul 29, 2023 at 16:07
  • 1
    I uninstalled OMZ, and then tried starting nano with nano -I, which has no affect and the problem still exists.
    – DanRan
    Aug 4, 2023 at 1:20
  • 2
    What is the value of $TERM? Aug 4, 2023 at 3:24
  • 3
    You never responded... are you using tmux or screen? Are you running this in Terminal.app or in iTerm or something else? Aug 7, 2023 at 22:10
  • 2
    If you don't know, you don't use it :-) Can you, in Terminal, run bash --noprofile --norc, and then in the newly started shell just nano?
    – nohillside
    Aug 13, 2023 at 19:06

2 Answers 2

3
+25

For what it's worth, I am having the same problem.

Running

TERM=vt100 nano

fixes it.

9
  • Thanks for the feedback. So it seems that the terminal definitions are somehow wrong or corrupted.
    – nohillside
    Aug 9, 2023 at 17:06
  • Yes, that also fixes it for me. But what was the problem, and what is the more permanent solution? How do i fix the terminal definitions @nohillside ?
    – DanRan
    Aug 13, 2023 at 15:34
  • @DanRan /usr/share/terminfo/78/xterm-256color in your case
    – nohillside
    Aug 13, 2023 at 16:09
  • I have no idea what /usr/share/terminfo/78/xterm-256color means or where it is to be used. Do you mean I should be entering the command TERM=/usr/share/terminfo/78/xterm-256color nano myfile.txt' or should I just enter TERM=/usr/share/terminfo/78/xterm-256color` ?
    – DanRan
    Aug 13, 2023 at 17:23
  • @nohillside Running the plain command /usr/share/terminfo/78/xterm-256color yields zsh: permission denied: /usr/share/terminfo/78/xterm-256color with admin and root users. What should I do with this line? Could you make a proper answer possibly? Thanks so much for all of your help!
    – DanRan
    Aug 13, 2023 at 17:24
0

I have solved it similar way as @acody suggest but with GUI (mac os 11.7.9 Big Sur): open terminal -> profiles -> advanced and find declare terminal as and choose vt100 enter image description here

You must log in to answer this question.

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