🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #569

Bash example for xterm users

#569
From: Brian Fox
Date: Sun, 10 Sep 1989 01:20
29 lines
1569 bytes
   Date: Fri, 08 Sep 89 19:35:42 -0700
   From: bothner@wsl.dec.com

   One solution is to have "normal" strings in PS1,
   and then alias cd,pushd, etc to have the side effect of
   changing the title bar. This works reasonably well in tcsh,
   but I haven't tried it for bash.

   It would also help if readline (?) could be made more robust.
   This may be hard for arbitrary control sequences, but one
   could have a convention that when calculating the length of
   a prompt string, only count characters after a '\r' or '\n'.
   Then one could place a '\r' after the "invisible" part of the prompt.

Yes, this should be done, but it will not solve the problem.  The
specific set of commands might be "esc-seq string esc-seq".  There is no
place in that string where a \r could be placed to tell bash where the
cursor was.


   Another solution is to do something like tcsh's precmd alias,
   which is automatically executed before each prompt.

You mean Bash's PROMPT_COMMAND variable?

   The "precmd" could be responsible for setting the title bar.

Brian
Technical Details
Message-ID: <8909100120.AA13312@aurel.caltech.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfox
References: <8909090235.AA09535@gilroy.pa.dec.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfox
From: bfox@AUREL.CALTECH.EDU (Brian Fox)
Newsgroups: gnu.bash.bug
Subject: Bash example for xterm users
Message-ID: <8909100120.AA13312@aurel.caltech.edu>
Date: 10 Sep 89 01:20:49 GMT
References: <8909090235.AA09535@gilroy.pa.dec.com>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: bfox@aurel.caltech.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 29