Bug 54509 - Problem with long compound PS1 values
Problem with long compound PS1 values
Product: Red Hat Linux
Classification: Retired
Component: pdksh (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
Depends On:
  Show dependency treegraph
Reported: 2001-10-10 13:54 EDT by ken_laird
Modified: 2007-04-18 12:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-24 17:36:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description ken_laird 2001-10-10 13:54:50 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.3-12smp i686)

Description of problem:
If a user sets their PS1 value to PS1="<${MACHINE#hpspk}:"'${PWD}'"> "  and
then cd's down a very long directory path such that the length of the
resulting prompt nears 80 characters,  characters no longer echo on the
command line.  If you cd a step or two back up the directory path, echoing
of characters typed returns.
If you create a PS1 value that is a very long simple string instead of a
compound value as above, the shell shifts the prompt to the left to make
room for command-line typing.  And the command line shifts left as needed
as you type.
So the problem only seems to be with a compound PS1 value.  The Bash shell
seems to handle this without the problem.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Set  your PS1 value to something like that listed above
2.cd down a long directory path such that it will take close to 80
characters to display
3. Then try typing something at the command line.

Actual Results:  Command line characters are not echoed when the compound
PS1 prompt value gets very long.

Expected Results:  Expected prompt to either wrap or shift left to

Additional info:
Comment 1 Trond Eivind Glomsrxd 2001-10-19 15:09:34 EDT
Comment 2 Karsten Hopp 2004-08-24 17:36:10 EDT
I see no sense in having a prompt which is so long that it needs to 
wrap. Easy fix: don't do that. Strip the prompt to the last or the 
last two directories. This is sufficient to know your current working 

Note You need to log in before you can comment on or make changes to this bug.