Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #12013

Re: [PATCH] Support configurable mode strings in prompt

Path csiph.com!xmission!news.glorb.com!usenet.stanford.edu!not-for-mail
From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: [PATCH] Support configurable mode strings in prompt
Date Mon, 14 Dec 2015 16:23:54 -0500
Lines 31
Approved bug-bash@gnu.org
Message-ID <mailman.2104.1450128243.31583.bug-bash@gnu.org> (permalink)
References <CAM1XmN9Xcb7t+2XjaG4QEmH3WAfC6bOEuFauGHYTB=BH4HxGtw@mail.gmail.com> <CAM1XmN_V7wnAuAcda37VhCj2AdGXirF9xeR1Ocy_jjS8cztT4w@mail.gmail.com> <mailman.8246.1409835641.1147.bug-bash@gnu.org> <dc8903d2-ab21-4945-9e8b-67944652058f@googlegroups.com> <CAM1XmN_7=9bBeyV7ptwi6DqdioSpBkOtvUuDtuHpvD8mPfcR7Q@mail.gmail.com> <54696200.8080905@case.edu> <CAM1XmN_8aAp8=Q1L=rJHACmi7Q64hNu-dKkz3SrXBQUTvxgGcg@mail.gmail.com>
Reply-To chet.ramey@case.edu
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Trace usenet.stanford.edu 1450128244 25426 208.118.235.17 (14 Dec 2015 21:24:04 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Alex Ford <alex.ford@codetunnel.com>, bug-bash@gnu.org, chet.ramey@case.edu
To Dylan Cali <calid1984@gmail.com>
Envelope-to bug-bash@gnu.org
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.4.0
In-Reply-To <CAM1XmN_8aAp8=Q1L=rJHACmi7Q64hNu-dKkz3SrXBQUTvxgGcg@mail.gmail.com>
X-Mirapoint-Virus-RAPID-Raw score=unknown(0), refid=str=0001.0A020201.566F336A.0399,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2015-08-12 04:07:17, dmn=2011-05-27 18:58:46
X-Mirapoint-Loop-Id 7c3e8e3b35847287898f14eff89a0bf2
X-Junkmail-Whitelist YES (by domain whitelist at mpv4-2015.case.edu)
X-Mirapoint-Virus-RAPID-Raw score=unknown(0), refid=str=0001.0A020202.566F336B.02EB,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2015-08-12 04:07:17, dmn=2011-05-27 18:58:46
X-Mirapoint-Loop-Id e7be052abfc06787ce10839c4a44b1e7
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy]
X-Received-From 129.22.103.195
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.14
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:12013

Show key headers only | View raw


On 12/6/15 10:34 PM, Dylan Cali wrote:
> 
> On Sun, Nov 16, 2014 at 9:48 PM, Chet Ramey <chet.ramey@case.edu
> <mailto:chet.ramey@case.edu>> wrote:
> 
>     Most of this will be in the next release of bash.  I added some things and
>     left out the \m prompt expansion for now.
> 
> 
> Hi Chet,
> 
> I finally had a chance to play with the 4.4 beta.  Unfortunately, it seems
> to be getting confused when color escapes are used (getting a lot of
> garbage when I switch to command mode).  These are the mode strings I used
> (just the defaults with green/yellow color escapes):
> 
>     set vi-ins-mode-string   \1\e[32;1m\2(ins)\1\e[0m\2
>     set vi-cmd-mode-string \1\e[33;1m\2(cmd)\1\e[0m\2

Thanks for the report.  The problem involved redrawing only the changed
portion of the prompt string (which is what readline's redisplay does by
default).  When the first differing character appears in a portion of the
prompt that is bracketed by non-printable characters, you have to redraw
the entire prompt to make sure that all the escape sequences are output.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: [PATCH] Support configurable mode strings in prompt Chet Ramey <chet.ramey@case.edu> - 2015-12-14 16:23 -0500

csiph-web