🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #885

Re: "Philosophical" bug: Bash needs an "invisiblity" sequence inside PS1

#885
From: Daniel S. Riley
Date: Thu, 10 Sep 1992 17:40
30 lines
1585 bytes
In article <9209060053.AA02428@arissoft.com> john@arissoft.COM writes:
>I use GNU Bash, version 1.12.9, and the terminal program I use is Stuart
>2.4 on a NeXT, which has title-bar-setting escape sequences that are a
>superset of those understood by Xterm.  A problem I was experiencing was
>that the Readline library used by Bash doesn't know what part of the prompt
>is actually visible.  So, if I have a big, nasty PS1 variable that puts
>lots of things in the title bar, Readline decides I've hit the 80th column
>and breaks the line way too early.

For title bar escape sequences, why not use PROMPT_COMMAND?  For instance,
my .bashrc has

  xtitle() {
    if [ $# -gt 1 ]; then
      echo -ne "\e]1;$1\a"
      echo -ne "\e]2;$2\a"
    else
      echo -ne "\e]0;$1\a"
    fi
  }

  cd_xtitle() {
    xtitle "$USER@$HOST" "$USER@$HOST  $PWD"
  }

  [ "$TERM" = "xterm" ] && PROMPT_COMMAND=cd_xtitle

-- 
-Dan Riley                          Internet: dsr@lns598.tn.cornell.edu
-Wilson Lab, Cornell University     HEPNET/SPAN: lns598::dsr (44630::dsr)
Technical Details
Message-ID: <1992Sep10.174049.2127@tc.cornell.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!theory.tc.cornell.edu!riley
References: <9209060053.AA02428@arissoft.com>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.bash.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!theory.tc.cornell.edu!riley
From: riley@theory.tc.cornell.edu (Daniel S. Riley)
Subject: Re: "Philosophical" bug:  Bash needs an "invisiblity" sequence inside PS1
Message-ID: <1992Sep10.174049.2127@tc.cornell.edu>
Sender: gnulists@ai.mit.edu
Organization: Cornell Theory Center
References: <9209060053.AA02428@arissoft.com>
Distribution: gnu
Date: Thu, 10 Sep 1992 17:40:49 GMT
Approved: bug-bash@prep.ai.mit.edu
Lines: 31