home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / shell / 4735 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.3 KB

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