LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-20-2017, 02:50 AM   #1
andrew.46
Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 825

Rep: Reputation: 163Reputation: 163
Sakura & -current: cycle through previous commands breaks prompt?


I am running sakura 3.3.3:
Code:
andrew@ilium~$ sakura --version
sakura version is 3.3.3
andrew@ilium~$
Under Slackware -current. When cycling through previous terminal commands using the up and down arrows I see that the prompt vanishes. My prompt is set in ~/.bashrc as follows:

Code:
# Sets the look of the prompt
export PS1='\[\u@\H\w\]$ '
Long commands pasted into a Sakura window have the same effect.

I have been working on this issue for some time with no result and I would be grateful if somebody could shed light on an annoying issue...
 
Old 03-21-2017, 01:38 AM   #2
jostber
Member
 
Registered: Jul 2001
Location: Skien, Norway
Distribution: Slackware 14.2 64-bit
Posts: 359

Rep: Reputation: 97
The Sakura version at SlackBuilds is at 3.4.0. Can you check if this works better?

https://slackbuilds.org/repository/14.2/system/sakura/
 
Old 04-13-2017, 11:00 PM   #3
andrew.46
Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 825

Original Poster
Rep: Reputation: 163Reputation: 163
Nice to now have the latest version but unfortunately the slightly annoying display problems persist...
 
Old 04-14-2017, 10:39 AM   #4
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware, Crux, NetBSD
Posts: 1,223

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Can't help, I'm afraid, other than to report 3.4.0 works fine with 14.2. Any other vte3 terminals with the same problem?
 
Old 04-15-2017, 12:42 AM   #5
andrew.46
Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 825

Original Poster
Rep: Reputation: 163Reputation: 163
Quote:
Originally Posted by Gerard Lally View Post
Can't help, I'm afraid, other than to report 3.4.0 works fine with 14.2. Any other vte3 terminals with the same problem?
Good news is that the same symptoms can be seen with xfce4-terminal and Konsole so I have made a misconfiguration. Now to ferret the fault out....


Edit: The problem is in my prompt settings:
Code:
# Sets the look of the prompt
export PS1='\[\u@\H\w\]$ '
and when this is commented out the problem disappears. Cannot quite see what I have done wrong here though...

Last edited by andrew.46; 04-15-2017 at 12:45 AM.
 
Old 04-15-2017, 08:06 AM   #6
jimX86
Member
 
Registered: Mar 2006
Distribution: Slackware64 14.2
Posts: 258
Blog Entries: 1

Rep: Reputation: 66
It's the escape characters. It doesn't look like you're using them for anything, so maybe try something like this...

PS1="\u@\H\w $"

I know this wasn't the question, but you could also shorten your prompt by just putting the working directory up in the titlebar instead.

PROMPT_COMMAND='echo -ne "\033]0; ${PWD}\007"'
 
1 members found this post helpful.
Old 04-15-2017, 09:37 AM   #7
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware, Crux, NetBSD
Posts: 1,223

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Quote:
Originally Posted by andrew.46 View Post
Good news is that the same symptoms can be seen with xfce4-terminal and Konsole so I have made a misconfiguration. Now to ferret the fault out....


Edit: The problem is in my prompt settings:
Code:
# Sets the look of the prompt
export PS1='\[\u@\H\w\]$ '
and when this is commented out the problem disappears. Cannot quite see what I have done wrong here though...
Don't escape the square brackets.
 
1 members found this post helpful.
Old 04-15-2017, 09:39 AM   #8
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware, Crux, NetBSD
Posts: 1,223

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Quote:
Originally Posted by jimX86 View Post
It's the escape characters. It doesn't look like you're using them for anything, so maybe try something like this...

PS1="\u@\H\w $"

I know this wasn't the question, but you could also shorten your prompt by just putting the working directory up in the titlebar instead.

PROMPT_COMMAND='echo -ne "\033]0; ${PWD}\007"'
I think a multiline prompt is better. If you put the working directory in the titlebar you lose out on it when you're in a VT or at the console.
 
Old 04-15-2017, 02:44 PM   #9
jimX86
Member
 
Registered: Mar 2006
Distribution: Slackware64 14.2
Posts: 258
Blog Entries: 1

Rep: Reputation: 66
Quote:
Originally Posted by Gerard Lally View Post
I think a multiline prompt is better. If you put the working directory in the titlebar you lose out on it when you're in a VT or at the console.
You don't have to choose. You can use #TERM to detect the terminal type and have a different prompt for each.

Anyway, sorry I brought it up. I didn't mean to distract from the original question, which I think has been answered now.
 
1 members found this post helpful.
Old 04-15-2017, 03:18 PM   #10
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware, Crux, NetBSD
Posts: 1,223

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Quote:
Originally Posted by jimX86 View Post
You don't have to choose. You can use #TERM to detect the terminal type and have a different prompt for each.
That occurred to me just after I posted! Thanks.
 
Old 04-16-2017, 04:48 PM   #11
andrew.46
Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 825

Original Poster
Rep: Reputation: 163Reputation: 163
Quote:
Originally Posted by jimX86 View Post
It's the escape characters. It doesn't look like you're using them for anything, so maybe try something like this...

PS1="\u@\H\w $"

Indeed this has solved the problem, thanks for resolving this annoying issue
 
Old 04-16-2017, 05:54 PM   #12
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Ireland
Distribution: Slackware, Crux, NetBSD
Posts: 1,223

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Quote:
Originally Posted by andrew.46 View Post
Indeed this has solved the problem, thanks for resolving this annoying issue
The \[ ... \] is used in bash to begin and end a sequence of non-printing characters, like colour escapes. Without them bash would get the terminal width wrong, and so on.

Your prompt doesn't contain colour escape sequences, so no need for the square brackets. In the following example, the escapes are necessary because PS1 contains a coloured user name in the prompt:

Code:
export PS1='\[$(tput setaf 033)\]\u\[$(tput sgr0)\]@\H\w\]$ '

Last edited by Gerard Lally; 04-16-2017 at 05:56 PM.
 
1 members found this post helpful.
  


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
[SOLVED] Highlight desired sections in previous command at prompt fanoflq Linux - Newbie 4 03-02-2016 02:36 PM
[SOLVED] Move the files between Current day & a previous day dsfreddie Linux - Newbie 9 06-10-2012 10:52 AM
Re: previous commands shravankumar.bbc Linux - Security 2 07-12-2011 10:02 AM
Clear previous commands in Terminal Hitboxx Fedora 4 07-12-2006 07:20 AM
TWM: cycle to next/previous window. robertmarkbram Linux - Software 0 05-03-2004 02:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:54 AM.

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