Closed mad-ady closed 3 years ago
On the system which has the issue you could try changing PL_ERASE_TO_EOL=false
to true and see if this helps.
If it is not resolved could you add a screenshot of the issue?
Thanks! I've tried, and it's weird! I've set it as false and re-logged in:
But! If I move the same window across a screen (I'm using dual screens with xinerama), then once the terminal window crosses the screen boundary, the window draws correctly (it's exactly the same window, nothing typed in):
I'm using xfce4-term Thanks! Edit - now I notice that it deletes the output from the previous grep command when redrawing the window...
Does the overwriting only happen at the bottom of the screen?
Can you give the output of echo $PS1
and echo $PROMPT_COMMAND
?
ps PL_ERASE_TO_EOL defaults to false so would need set to true
It's hard to say if the overwriting happens at the bottom of the screen. My prompt is always near the bottom. I've expanded a terminal window (only its height), so that the prompt is somewhere in the middle of the window and the overwriting behaviour is the same.
Here are the outputs you requested:
adrianp 💻 frost ~ $ echo $PS1
\[\e[0;30m\]\[\e[48;5;119m\] \u
\[\e[0;30m\]\[\e[48;5;119m\]\[\e[0;30m\]\[\e[48;5;119m\] 💻 \h
\[\e[38;5;119m\]\[\e[48;5;69m\]\[\e[0;30m\]\[\e[48;5;69m\] \w
\[\e[38;5;69m\]\[\e[48;5;240m\]\[\e[0;37m\]\[\e[48;5;240m\] $
\[\e[38;5;240m\]\[\e[49m\]\[\e[0m\] \[\e]2; \u@\h: \w \a
adrianp 💻 frost ~ $ echo $PROMPT_COMMAND
pureline_ps1; echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"
adrianp 💻 frost ~ $
I've tried with it set to true and there is no change in behavior:
On Thu, Mar 18, 2021 at 1:55 PM Chris Marsh @.***> wrote:
Does the overwriting only happen at the bottom of the screen? Can you give the output of echo $PS1 and echo $PROMPT_COMMAND? ps PL_ERASE_TO_EOL defaults to false so would set to true.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chris-marsh/pureline/issues/60#issuecomment-801862273, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAO6KRIF22AJ6R2HCJO5I3TEHSZRANCNFSM4ZMFFLEA .
I've tested your PS1 and it behaves properly on my work PC (Windows Terminal WS2 Ubuntu 20.4) while ssh'd to an Arch Linux box. I'll test it some more when I'm home later. However, my initial thought is to try not using the ssh symbol. Unset it or set it to '' and see what happens. Also, xfce4-terminal has a setting in preferences/compatibility for "Ambiguous-width characters", I'd try changing that and testing the results.
Ambiguous width characters set to wide just makes the prompt a bit wider for me.
I've also set PL_SYMBOLS[ssh]=""
and it behaves the same way with regard to line wrapping.
Are there any commands I could use to "calculate" the width of the terminal? Most likely it's caused by bad counting...
I'm struggling to reproduce the issue. But just to recap for my benefit;
The only differences between working Vs glitching are;
I think we've ruled out (1) but to be sure I'd comment it out of the config and see if the issue persists. I'd also try and compare the bashrc files and env variables.
That pretty much sums it up :)
I've tried the following:
Last login: Mon Mar 22 12:19:10 2021 from 192.168.1.11
7890ianp ~ $ echo 1234567890 1234567890 1234567890 1234567890 123456
I still get the same wrapping behavior (without a new line), but it takes longer to happen because the prompt is shorter (which is expected).
For environment: Remote side:
adrianp ~ $ bash --version
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
adrianp ~ $ env
SHELL=/bin/bash
HISTCONTROL=ignoreboth
DERBY_HOME=/usr/lib/jvm/java-11-oracle/db
HISTSIZE=-1
LANGUAGE=en
LC_ADDRESS=en_US.UTF-8
JAVA_HOME=/usr/lib/jvm/java-11-oracle
USE_CCACHE=1
LC_NAME=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
PWD=/home/adrianp
LOGNAME=adrianp
XDG_SESSION_TYPE=tty
IDF_PATH=/home/adrianp/development/esp/esp-idf
SCREENDIR=/home/adrianp/.screen
J2REDIR=/usr/lib/jvm/java-11-oracle
MOTD_SHOWN=pam
HOME=/home/adrianp
LANG=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
SSH_CONNECTION=192.168.1.11 42992 172.23.23.50 22
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
LC_IDENTIFICATION=en_US.UTF-8
J2SDKDIR=/usr/lib/jvm/java-11-oracle
LESSOPEN=| /usr/bin/lesspipe %s
LIBVIRT_DEFAULT_URI=qemu:///system
USER=adrianp
SHLVL=1
LC_TELEPHONE=en_US.UTF-8
LC_MESSAGES=C
LC_MEASUREMENT=en_US.UTF-8
XDG_SESSION_ID=2597
LC_CTYPE=en_US.UTF-8
XDG_RUNTIME_DIR=/run/user/1001
SSH_CLIENT=192.168.1.11 42992 22
LC_TIME=en_US.UTF-8
LC_ALL=C
LC_COLLATE=en_US.UTF-8
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
PATH=/home/adrianp/.local/bin:/home/adrianp/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-11-oracle/bin:/usr/lib/jvm/java-11-oracle/db/bin:/home/adrianp/bin:/home/adrianp/android-sdk-linux/tools:/home/adrianp/android-sdk-linux/platform-tools:/home/adrianp/development/algs4/bin:/home/adrianp/development/esp/xtensa-esp32-elf/bin:/home/adrianp/development/esp/xtensa-esp32-elf/bin
HISTFILESIZE=-1
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus
SSH_TTY=/dev/pts/6
LC_NUMERIC=en_US.UTF-8
_=/usr/bin/env
Local side:
adrianp ~ $ bash --version
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
adrianp ~ $ env
SHELL=/bin/bash
SESSION_MANAGER=local/stingray:@
/tmp/.ICE-unix/2569,unix/stingray:/tmp/.ICE-unix/2569
WINDOWID=102787417
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_MENU_PREFIX=xfce-
CLUTTER_BACKEND=x11
LANGUAGE=en_US
MANDATORY_PATH=/usr/share/gconf/xubuntu.mandatory.path
LC_ADDRESS=en_US.UTF-8
LC_NAME=en_US.UTF-8
SSH_AUTH_SOCK=/run/user/1001/keyring/ssh
DESKTOP_SESSION=xubuntu
LC_MONETARY=en_US.UTF-8
SSH_AGENT_PID=2722
XDG_SEAT=seat0
PWD=/home/adrianp
LOGNAME=adrianp
XDG_SESSION_DESKTOP=xubuntu
QT_QPA_PLATFORMTHEME=gtk2
XDG_SESSION_TYPE=x11
PANEL_GDK_CORE_DEVICE_EVENTS=0
GPG_AGENT_INFO=/run/user/1001/gnupg/S.gpg-agent:0:1
XAUTHORITY=/home/adrianp/.Xauthority
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/adrianp
GDM_LANG=en_US
HOME=/home/adrianp
LC_PAPER=en_US.UTF-8
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_CURRENT_DESKTOP=XFCE
VTE_VERSION=6003
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
LC_IDENTIFICATION=en_US.UTF-8
GTK_OVERLAY_SCROLLING=0
DEFAULTS_PATH=/usr/share/gconf/xubuntu.default.path
LESSOPEN=| /usr/bin/lesspipe %s
USER=adrianp
DISPLAY=:0.0
SHLVL=1
LC_TELEPHONE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
XDG_VTNR=7
XDG_SESSION_ID=c2
LC_CTYPE=en_US.UTF-8
XDG_RUNTIME_DIR=/run/user/1001
LC_TIME=en_US.UTF-8
LC_ALL=
LC_COLLATE=en_US.UTF-8
XDG_DATA_DIRS=/usr/share/xfce4:/usr/share/xubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop:/var/lib/snapd/desktop:/usr/share
PATH=/home/adrianp/bin:/home/adrianp/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
GDMSESSION=xubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus
LC_NUMERIC=en_US.UTF-8
_=/usr/bin/env
Anything of use here? I'll try without bashrc on the remote side and see if there's anything problematic there.
This is the remote side without a bashrc (and no pureline loaded):
***@***.***:~$ echo 1234567890 1234567890 1234567890 1234567890
1234567890 123
4567890
1234567890 1234567890 1234567890 1234567890 1234567890 1234567890
As you can see, it wraps correctly. Next, I loaded pureline and I see the same wrapping behavior:
***@***.***:~$ echo $TERM
xterm-256color
***@***.***:~$ source /usr/local/pureline/pureline ~/.pureline.conf
7890ianp frost ~ $ echo 1234567890 1234567890 1234567890 123456
1234567890 1234567890 1234567890 1234567890
adrianp frost ~ $
I've also tried a different terminal (xterm), and it behaves the same way (except it doesn't render all UTF-8 characters). Here's a screnshot:
Let me know if I can try other things.
On Thu, Mar 18, 2021 at 10:08 PM Chris Marsh @.***> wrote:
I'm struggling to reproduce the issue. But just to recap for my benefit;
- Your using xfce4-terminal
- You start a session working local and PureLine behaves as expected.
- Using the same window/session, you ssh to another system which uses an identical config
- PureLine glitches and overwrites the prompt instead of going to a newline.
The only differences between working Vs glitching are;
- ssh segment in pureline
- bash envirtonment: version / setup / variables
I think we've ruled out (1) but to be sure I'd comment it out of the config and see if the issue persists. I'd also try and compare the bashrc files and env variables.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chris-marsh/pureline/issues/60#issuecomment-802252703, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAO6KTJWQ4HSG4VV3OVYGDTEJMTDANCNFSM4ZMFFLEA .
Think I've found it ... although I'll need to research the why :) Your remote does not have the LANG environment variable set. If I unset this I can recreate your issue.
Also found this referenced in the official PowerLine documentation here
You need to set your LANG and LC_* environment variables to a UTF-8 locale (e.g. LANG=en_US.utf8). Consult your Linux distro’s documentation for information about setting these variables correctly.
Nice catch! Though both systems have LANG set, the remote system has LC_ALL=C (funny enough, I can't find where it gets set. I explicitly unset it with unexport LC_ALL in .bashrc):
local:
adrianp ~ $ echo $LANG
en_US.UTF-8
adrianp ~ $ echo $LC_LANG
adrianp ~ $ echo $LC_ALL
adrianp ~ $ echo $LC_COLLATE
en_US.UTF-8
adrianp ~ $ echo $COLUMNS
80
adrianp ~ $
remote:
adrianp frost ~ $ echo $LANG
en_US.UTF-8
adrianp frost ~ $ echo $LC_LANG
adrianp frost ~ $ echo $LC_ALL
C
adrianp frost ~ $ echo $LC_COLLATE
en_US.UTF-8
adrianp frost ~ $ echo $COLUMNS
80
Now, after suppressing LC_ALL, the behavior is better, but alas, there's still an issue...
The line now wraps, as it should, and I can type the next 4 characters correctly, after which the cursor jumps to the line start and the following characters overwrite (visually) the first 4 characters... This backwards cursor behavior I've seen on other systems as well, but using other ssh clients (e.g. JuiceSSH), and I haven't looked into. So, it might be a different issue...
Thanks a lot for the assistance and hand-holding...
On Mon, Mar 22, 2021 at 1:12 PM Chris Marsh @.***> wrote:
Also found this referenced in the official PowerLine documentation here https://powerline.readthedocs.io/en/master/troubleshooting/linux.html
You need to set your LANG and LC_* environment variables to a UTF-8 locale (e.g. LANG=en_US.utf8). Consult your Linux distro’s documentation for information about setting these variables correctly.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chris-marsh/pureline/issues/60#issuecomment-803981065, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAO6KQIE4MO6I4OSR4M6KLTE4Q3JANCNFSM4ZMFFLEA .
Yup you are of course right, LANG is correctly set on both .... tired head on a Monday morning so I wasn't seeing it ... but I think locale settings are on the right track ;)
Does the output of locale
look right?
They are not the same... I'll try making the same changes to the remote side and see if it improves things and report back: local:
adrianp ~ $ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=
remote:
adrianp frost ~ $ locale
LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=C
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=
On Mon, Mar 22, 2021 at 4:58 PM Chris Marsh @.***> wrote:
Yup your of course, LANG is correctly set on both .... tired head on a Monday morning so I wasn't seeing it ... but I think locale settings are on the right track ;)
Does the output of locale look right?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chris-marsh/pureline/issues/60#issuecomment-804129196, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAO6KQ6JPREMN5WWR5AAJDTE5LK5ANCNFSM4ZMFFLEA .
Sorry for not replying sooner. I've set the same locale settings on the remote side as the local client.
adrianp frost ~ $ echo 1234567890 1234567890 1234567890 12345678904123 1234567890 1234567890 1234567890 1234567890 1234 adrianp frost ~ $ locale LANG=en_US.UTF-8 LANGUAGE=en LC_CTYPE=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8 LC_ALL=
Line wrapping works ok, but I do get the "cursor jumping back 4 characters" when going to the first new line. What I hadn't noticed is that the same behavior happens on my host PC as well.
I'll open a new case for it, since it's a different issue.
Thanks for the help!
Hello! I'm using your pureline code to beautify my prompts. Thanks for your work!
I've installed the current latest git version, but I still have an issue on a Ubuntu 20.04 system. I'm using xfce-term4 and I ssh from a Ubuntu 20.04 system. I'm using the same config line on both systems. On my local system line wrapping works correctly. Over ssh, with pureline enabled, it doesn't work correctly for the first line! Here is my config: https://paste.ubuntu.com/p/fDsKPmq68B/
Any suggestions what I should be looking for? Thanks!