LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-20-2017, 02:37 PM   #1
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 4,675

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
How to fix prompt in terminal


what you see here is if I up arrow and back off on text the cursor block backs up over top of the $ not stopping before it.
Code:
userx@slackwhere⚡️~⚡️$ rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrwwewewe
bash: rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrwwewewe: command not found
userx@slackwhere⚡️~
Code:
export PS1="\\[\e[36m\]\u\[\e[31m\]@\[\e[37m\]\h\\[⚡️\]\[\e[34m\]\w\\[\e[m\]\[⚡️\]\$ "
at times it will wrap and type over top of text already written, even in nano it messes up the text while typing. half of the text will look like it is not there when it is and such craziness I find hard to put into words.

I already ran this
Code:
 shopt -s checkwinsize
 
Old 03-21-2017, 07:51 AM   #2
hydrurga
Senior Member
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 18.2 MATE
Posts: 3,491
Blog Entries: 2

Rep: Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196
I don't know if this helps or not, BW, but you appear to have an unnecessary \ right at the beginning of the string.

Also, given that ⚡️ is a printable character, it doesn't need to be in a non-printable escape sequence.

There is also an extra \ after the \h and before your unneeded non-printable escape sequence.

So:

Code:
"\[\e[36m\]\u\[\e[31m\]@\[\e[37m\]\h⚡️\[\e[34m\]\w\\[\e[m\]⚡️\$ "
 
Old 03-21-2017, 10:34 AM   #3
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 4,675

Original Poster
Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Quote:
Originally Posted by hydrurga View Post
I don't know if this helps or not, BW, but you appear to have an unnecessary \ right at the beginning of the string.

Also, given that ⚡️ is a printable character, it doesn't need to be in a non-printable escape sequence.

There is also an extra \ after the \h and before your unneeded non-printable escape sequence.

So:

Code:
"\[\e[36m\]\u\[\e[31m\]@\[\e[37m\]\h⚡️\[\e[34m\]\w\\[\e[m\]⚡️\$ "
I broke it down to this
Code:
export PS1="\\[\e[36m\]\u\[\e[31m\]@\[\e[37m\]\h:\[\e[34m\]\w\[\e[m\]\[⚡️\]\$ "
- that extra \ at the begning is from some how to page on this - I'll copy paste yours and see what happens.
Thanks.

Last edited by BW-userx; 03-21-2017 at 10:36 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
terminal prompt different from console prompt dh2k Slackware 5 03-29-2010 04:38 PM
Terminal prompt goes away poriajay Linux - Newbie 1 05-21-2008 08:53 PM
cant get Terminal Prompt binay_gupta Linux - General 1 08-19-2006 07:18 AM
no prompt in terminal xyfan Linux - Newbie 1 12-05-2003 11:25 PM
terminal with no prompt fletch88 Red Hat 0 11-17-2003 12:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration