Linked Questions

1
vote
1answer
47 views

What/when could possibly break if I don't include \[\] around the color code in bash script? [duplicate]

I was messing around with the color codes trying to understand how color code is used in bash script and I found that it works fine without including \[\] around it as in here: This.. red="\033[38;...
31
votes
5answers
65k views

How to make the terminal display user@machine in bold letters?

I have seen in some screen-shots (can't remember where on the web) that the terminal can display the [username@machine /]$ in bold letters. I'm looking forward to getting this too because I always ...
22
votes
2answers
3k views

Can the empty spaces/background in a terminal be replaced with a random(but pretty) pattern of ASCII characters?

Context and Question There are many ways to colorize the terminal and shell environment. The output of individual commands, such as ls and grep, can also be colorized. Not directly related but ...
71
votes
9answers
130k views

How to solve the issue that a Terminal screen is messed up? (usually after a resizing)

Sometimes, a terminal screen is messed up, and when we use man ls to read the manpages, or press the UP arrow to go to previous commands in history, the screen will show characters not as the right ...
0
votes
1answer
83 views

Why does my custom bash prompt glitch when browsing the history [duplicate]

I have set up a custom bash prompt so I can see stuff like the current git branch, npm package version info, the virtual env I'm in, etc. However, when i press the up arrow key to browse the history, ...
2
votes
3answers
719 views

Bash commands get truncated when pasting multiple commands to terminal

I copy/pasted the following 100 lines into my terminal (xterm) to execute those on a server I am connected to over ssh: mv /long/path/to/file1 /longer/path/to/file1 mv /long/path/to/file2 /longer/...
1
vote
1answer
41 views

Why is my previous history command in the terminal overwriting other text? [duplicate]

Here is my .bashrc config for ps1 i believe ive done it correctly but any time i press up for a previous command it gets all jumbled up. I can write long lines of commands without it wrapping only the ...
2
votes
1answer
365 views

colorize hostname in command line prompt [duplicate]

I wish to set a custom color for the hostname portion of my command line prompt (in bash). In my .bashrc file, the default command line prompt is: PS1='[\u@\h \W]\$ ' To colorize the hostname only, ...
1
vote
1answer
494 views

Bash prompt over-writing current line

I am having similar problems to this thread here, with the command line overwriting the line and my up arrow overwriting all of the text. Terminal prompt not wrapping correctly When I run $ shopt ...
3
votes
3answers
1k views

bash: messed up display for long lines

I am using the GNU bash, version 4.4.0(1) on Ubuntu 16.04. When I enter long lines in my bash, its display is messed up. For example, assuming I am in ~/test/test/test/test/test/test/test and I ...
60
votes
2answers
18k views

Why is my bash prompt getting bugged when I browse the history? [duplicate]

Often when I start looking at history of commands some of the characters from a command displayed aren't erased, for example: What's happening: prompt$ some_command prompt$ some_commanother_command ...
2
votes
1answer
205 views

String artifacts from history on commandline [duplicate]

When I scroll through the bash history with the arrow keys and hit (for example) the following string: git clone hgit clone https://github.com/electron/electron-quick-start In the next line of ...
0
votes
1answer
1k views

Where to put the escape characters? [duplicate]

I've tried to change my prompt by editing .bashrc: export PS1="\e[0;32m[\u@\h \W]\$ \e[m" This seems to work, but ctrl-r to access reverse history ends up with my typing not appearing in the same ...
3
votes
1answer
956 views

Bash doesn't calculate prompt length correctly

I've googled around quite a bit on this problem and found a few related problems, like this one: Terminal prompt not wrapping correctly. My problem is that bash doesn't calculate the length of the ...
6
votes
1answer
1k views

Terminal prompt overwrites current line

I have an issue with my terminal prompt line. When the line is too long it wraps on the same line and then Up arrow makes it look even worse. I have already checked Terminal prompt not wrapping ...

15 30 50 per page