powerline-go
powerline-go copied to clipboard
Bash wrapping issue on Debian 10 container
As you can see in the container the wrapping does not happen. It works in Ubuntu based container fine.
Use this docker image to reproduce the issue FROM mcr.microsoft.com/dotnet/core/sdk:3.1
.
https://hub.docker.com/_/microsoft-dotnet-core-sdk?tab=description
Have the same issue though it only seems to happen sometimes. Not sure what the trigger is
In the Debian container? Happened to me always.
I am having this problem with Win10 using the new terminal
@andrzejnovak Are you using powershell? It works fine for bash on WSL 2 using the new Terminal.
@ankitbko Nah using bash, same problem also using hyper
Same issue on arch linux.
Thus seems to be an issue with your Terminal emulator, as neither the IntelliJ emulator, Konsole, iTerm, Gnome Terminal, xTerm, nor the linux tty console have issues with this.
It occurs on Konsole in Manjaro Linux (Arch based). If I set the default Linux prompt the issue doesn't occur, so it's not a Terminal issue.
This is my prompt :
PS1="$(/usr/bin/powerline-go -cwd-max-depth 4 -modules user,cwd,git,venv,jobs,exit,root -error $?)"
Started happening again on a new Linux VM with containors in it. Any idea on how to debug this?
This is caused by wrong length calculation of special characters (e.g. U+E0B0
).
Here's a hacky fix:
# ~/.bashrc
function _update_ps1() {
PS1="$($GOPATH/bin/powerline-go -newline -error $?)"
# add the following line
PS1="${PS1//$'\356\202\260'/$'\[$(tput sc)\] \[$(tput rc)\356\202\260\]'}"
# or more intuitive
# PS1="${PS1///'\[$(tput sc)\] \[$(tput rc)\]'}"
}
@eternalphane looked promising for a moment, but it doesn't solve it for me
Ya didn't work for me either. But maybe the root cause is regarding wrong length calculation. Is there a generic solution for this?
@andrzejnovak @ankitbko ~~maybe you should check the output of printf "%q\n" "$GOPATH/bin/powerline-go -newline -error $?"
(or whatever in your .bashrc) to find the actual issue in your case.~~
Alright, finally found a promising solution: set LC_ALL
to C.UTF-8
(or make sure LC_CTYPE
is utf-8 locale). Maybe this should be added to the doc.
I can't reproduce the issue, but this is a known issue with prompt length / window size. I would try looking at https://unix.stackexchange.com/questions/105958/terminal-prompt-not-wrapping-correctly
@dswij can I see your output of locale
? I just want to confirm if it's related to locale settings.
@dswij can I see your output of
locale
? I just want to confirm if it's related to locale settings.
UTF-8
UTF-8
Just checked with a fresh installed Debian 10 in Hyper-V, the default LC_ALL
is empty. Then I'm wondering why my LC_ALL
is assigned a value...😕
Changing the LC_ALL
doesn't seem to affect this for me
Changing the
LC_ALL
doesn't seem to affect this for me
@andrzejnovak what's the output of test=''; echo ${#test}
on your machine?
@eternalphane 1
@andrzejnovak emmm... I have no idea what's happening on your side
Changing the
LC_ALL
doesn't seem to affect this for me@andrzejnovak what's the output of
test=''; echo ${#test}
on your machine?
Mine also shows 1
This happens for me on Fedora 34 with bash. No containers involved. Happens with xfce4-terminal
and gnome-terminal
.
Looks to be a bug with the termtitle
module. If I don't enable that in my -modules ...
list, I no longer experience the bug.
any solution ?, im having this issue also
The "hacky fix" kindly provided by @eternalphane worked for me.