home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ukma!usenet.ins.cwru.edu!odin!chet
- From: chet@odin.ins.cwru.edu (Chet Ramey)
- Newsgroups: comp.unix.shell
- Subject: Re: newline in bash v1.12 with long PS1
- Date: 16 Nov 1992 21:36:31 GMT
- Organization: Case Western Reserve University, Cleveland OH (USA)
- Lines: 26
- Message-ID: <1e948vINN25k@usenet.INS.CWRU.Edu>
- References: <yw70TB1w165w@willard.UUCP>
- NNTP-Posting-Host: odin.ins.cwru.edu
-
- In article <yw70TB1w165w@willard.UUCP> hronr@willard.UUCP writes:
- >
- >Roughly:
- >PS1=<esc>[0;1;35m\!<esc>[32m${PWD}<esc>[35m$ <esc>[33m
- >(the PS1 is single quoted.)
- >
- >When I am in a deep directory like /usr/spool/lp/admins/lp/interfaces
- >and I type a command, bash throws in a newline before I hit <enter>.
-
- Bash does not know the `true' length of your prompt, because some of the
- characters are non-printing. It wraps when it thinks it's about to hit
- the end of the line. You can fix this by putting \n into PS1 after
- the last non-printing character. This will make your prompt two lines,
- but bash will not be confused about the length.
-
- >I also note that in sh, ksh, and csh you can
- >backspace over the prompt. In bash you cannot.
-
- This is a problem?
-
- Chet
- --
- ``The use of history as therapy means the corruption of history as history.''
- -- Arthur Schlesinger
-
- Chet Ramey, Case Western Reserve University Internet: chet@po.CWRU.Edu
-