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