home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / bash / bug / 600 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.5 KB  |  45 lines

  1. Newsgroups: gnu.bash.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!theory.tc.cornell.edu!riley
  3. From: riley@theory.tc.cornell.edu (Daniel S. Riley)
  4. Subject: Re: "Philosophical" bug:  Bash needs an "invisiblity" sequence inside PS1
  5. Message-ID: <1992Sep10.174049.2127@tc.cornell.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Cornell Theory Center
  8. References: <9209060053.AA02428@arissoft.com>
  9. Distribution: gnu
  10. Date: Thu, 10 Sep 1992 17:40:49 GMT
  11. Approved: bug-bash@prep.ai.mit.edu
  12. Lines: 31
  13.  
  14. In article <9209060053.AA02428@arissoft.com> john@arissoft.COM writes:
  15. >I use GNU Bash, version 1.12.9, and the terminal program I use is Stuart
  16. >2.4 on a NeXT, which has title-bar-setting escape sequences that are a
  17. >superset of those understood by Xterm.  A problem I was experiencing was
  18. >that the Readline library used by Bash doesn't know what part of the prompt
  19. >is actually visible.  So, if I have a big, nasty PS1 variable that puts
  20. >lots of things in the title bar, Readline decides I've hit the 80th column
  21. >and breaks the line way too early.
  22.  
  23. For title bar escape sequences, why not use PROMPT_COMMAND?  For instance,
  24. my .bashrc has
  25.  
  26.   xtitle() {
  27.     if [ $# -gt 1 ]; then
  28.       echo -ne "\e]1;$1\a"
  29.       echo -ne "\e]2;$2\a"
  30.     else
  31.       echo -ne "\e]0;$1\a"
  32.     fi
  33.   }
  34.  
  35.   cd_xtitle() {
  36.     xtitle "$USER@$HOST" "$USER@$HOST  $PWD"
  37.   }
  38.  
  39.   [ "$TERM" = "xterm" ] && PROMPT_COMMAND=cd_xtitle
  40.  
  41. -- 
  42. -Dan Riley                          Internet: dsr@lns598.tn.cornell.edu
  43. -Wilson Lab, Cornell University     HEPNET/SPAN: lns598::dsr (44630::dsr)
  44.  
  45.