Score:0

Terminal adds extra spaces after $ when running history commands with up and down arrows

ng flag

I tried to update my terminal for a better look. I followed this guide here. I got the result I wanted but when I try to see previous commands with up and down arrows, it freezes the terminal to start at a random midpoint of the terminal. Also, I noticed that this happens when there is a longer command in my history like connecting a remote desktop with ssh.

These are my edits on ".bashrc"

force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\>
else
 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W$(parse_git_branch)\$ '
fi
unset color_prompt force_color_prompt


export PS1='\[\e[01;32m\][\W]=>\e[0m\] :\e[01;33m\]$(parse_git_branch)$\e[37;1m\]\]'
PS1=$PS1'\[\e]2;\u@\w\a\]' #set teminal title

enter image description here

enter image description here

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.