-1

I wanted to put the Unicode character Δ into PS1, but when I did, when typing in long commands, the terminal wouldn't wrap to a newline but would overwrite the current line!

The problem doesn't occur when I remove the Unicode character, and I am pretty sure I escaped everything.

export PS1="Δ "

The terminal overwriting the current line

How do I fix this?

Term. Info:

$BASH_VERSION => 5.0.16(1)-release
        $TERM => xterm-256color
! stty
speed 38400 baud; line = 0;
-brkint -imaxbel iutf8

P.S. the solution at bash prompt not wrapping as expected also resulted in odd behavior, due to the fact that ignoring the Unicode character also results in an incorrect character count.

Bill
  • 131

1 Answers1

3

As @mosvy said in the comments, the problem was the locale setting!

My locale was set to a non-existing locale, so I changed it to one that actually exists, which in my case was C.UTF-8 (get a list of locales with locale -a).

export LC_ALL="C.UTF-8"
Bill
  • 131