View previous topic :: View next topic |
Author |
Message |
while true Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/5603229994bc8ecae4960b.gif)
Joined: 07 Apr 2010 Posts: 532 Location: Ljubljana, Slovenia
|
Posted: Tue Nov 13, 2018 8:24 pm Post subject: terminal not clearing the line when scrolling past commands |
|
|
Hello Gentoo people
I have ubuntu on laptop, and i have several rpi's and on my main box i have gentoo.
I believe it is my bad english that produced no answer searching the internet so I thought i might ask for help here.
I have 2 terminals, xterm and st, on gentoo. As i use up arrow button to get past commands it does not cleas some commands.
It is hard to explain so i made a very short video, it happens at 10 seconds
https://www.youtube.com/watch?v=kqJn0ajsfZw
This happens only on gentoo.
Is there something i can do?
Thank you _________________ Kind regards, Goran Mitic
alive
while true
kick ass |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
eccerr0r Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
Joined: 01 Jul 2004 Posts: 9898 Location: almost Mile High in the USA
|
Posted: Tue Nov 13, 2018 9:41 pm Post subject: |
|
|
I noticed that you have color in your text and it differs than of your prompt. Perhaps your PS1 prompt doesn't have all the codes needed to tell bash what to clear. If you clear PS1 to something very simple like PS1='$ ' can you reproduce the problem?
Or perhaps something in your history has some control codes that is confusing bash. From a clean environment (i.e. no history), is this readily reproducable? _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
while true Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/5603229994bc8ecae4960b.gif)
Joined: 07 Apr 2010 Posts: 532 Location: Ljubljana, Slovenia
|
Posted: Tue Nov 13, 2018 11:51 pm Post subject: |
|
|
Hello eccerr0r,
You are right on the point, it is PS1
with PS1='$ ' i could not reproduce the problem (xterm or st). my PS1 is
PS1='\e[0;32m\]\u@\h \w \$\e[0m\] '
and i copy & pasted that from some colourful online bashrc.
Thank you, i will now look for correct PS syntax _________________ Kind regards, Goran Mitic
alive
while true
kick ass |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
eccerr0r Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
Joined: 01 Jul 2004 Posts: 9898 Location: almost Mile High in the USA
|
Posted: Wed Nov 14, 2018 12:01 am Post subject: |
|
|
I'd try this
Code: | PS1='\[\e[0;32m\]\u@\h \w \$\[\e[0m\] ' |
_________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
while true Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/5603229994bc8ecae4960b.gif)
Joined: 07 Apr 2010 Posts: 532 Location: Ljubljana, Slovenia
|
Posted: Wed Nov 14, 2018 12:36 am Post subject: |
|
|
hey eccerr0r,
yes i see i have some 'brackets' missing, i found this page:
https://www.ibm.com/developerworks/linux/library/l-tip-prompt/
and came up with this:
Code: | PS1='\[\e[36;1m\]\u\[\e[33;1m\]@\[\e[36;1m\]\h \[\e[32;1m\]\w \[\e[36;1m\]\$ \[\e[31;1m\]> \[\e[0m\]' |
Again, thank you for your time and input, man, sure did lift the stone from my hart, <3 _________________ Kind regards, Goran Mitic
alive
while true
kick ass |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
josephg l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/5277610355ba555d6aa280.png)
Joined: 10 Jan 2016 Posts: 783 Location: usually offline
|
Posted: Wed Nov 14, 2018 11:09 pm Post subject: |
|
|
while true wrote: | my PS1 is
PS1='\e[0;32m\]\u@\h \w \$\e[0m\] ' |
what eccerr0r said. you have to enclose non-printing characters within \[ and \]
thus your above prompt should be
Code: | PS1='\[\e[0;32m\]\u@\h \w \$\[\e[0m\] ' |
you are terminating them ok but without starting
http://nixventure.blogspot.com/2018/10/shell-in-colours.html _________________ "Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|