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

  1. Newsgroups: gnu.bash.bug
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!artcom0.NOrth.DE!pf
  3. From: pf@artcom0.NOrth.DE (Peter Funk)
  4. Subject: Re: "Philosophical" bug: Bash needs an "invisiblity" sequence inside PS1
  5. Message-ID: <4376@artcom0.north.de>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: ArtCom GmbH, Atelier f. Computergrafik, Bremen(FRG)
  8. References: <9209060053.AA02428@arissoft.com> 
  9. Distribution: gnu
  10. Date: Mon, 14 Sep 1992 08:24:18 GMT
  11. Approved: bug-bash@prep.ai.mit.edu
  12. Lines: 40
  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. In <1992Sep10.174049.2127@tc.cornell.edu> riley@theory.tc.cornell.edu (Daniel S. Riley) writes:
  24. > For title bar escape sequences, why not use PROMPT_COMMAND?  For instance,
  25. > my .bashrc has
  26. [...neat workaround deleted...]
  27.  
  28. Also this works for title strings, it is no solution for those of
  29. us, who want to include escape sequences _INTO_ the prompt.  
  30. I like to have the host name included into the prompt string
  31. and highlighted by inverse video.  So my prompt is defined as:
  32.  
  33.     ME=`logname`
  34.     if [ -w /etc/passwd ]
  35.     then PCH="#"
  36.     else PCH=">"
  37.     fi
  38.     SMSO=`tput smso` 
  39.     RMSO=`tput rmso`
  40.     PS1="$ME@$SMSO\h$RMSO:$TERMLINE \w \!$PCH "
  41.  
  42. I have omitted the code to determine $TERMLINE (which will be
  43. usually something like 'tty05'), because it is somewhat nasty 
  44. and has nothing to do with problem here.
  45.  
  46. Regards, Peter
  47. Note: The usual "english_is_not_my_native_language"-disclaimer applies
  48.       to this "kraut"-babble.
  49. -=-=-
  50. Peter Funk \\ ArtCom GmbH, Schwachhauser Heerstr. 78, D-2800 Bremen 1
  51. Work at home: Oldenburger Str.86, D-2875 Ganderkesee 1 / voice : top secret
  52.  
  53.  
  54.