From owner-freebsd-questions Mon Apr 17 10:25:57 2000 Delivered-To: freebsd-questions@freebsd.org Received: from ren.sasknow.com (ren.sasknow.com [207.195.92.131]) by hub.freebsd.org (Postfix) with ESMTP id EA02137BA04 for ; Mon, 17 Apr 2000 10:25:54 -0700 (PDT) (envelope-from ryan@sasknow.com) Received: from localhost (ryan@localhost) by ren.sasknow.com (8.9.3/8.9.3) with ESMTP id LAA67812; Mon, 17 Apr 2000 11:26:27 -0600 (CST) (envelope-from ryan@sasknow.com) Date: Mon, 17 Apr 2000 11:26:27 -0600 (CST) From: Ryan Thompson To: "Eric J. Schwertfeger" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: bash line wrapping with ANSI colours In-Reply-To: Message-ID: Organization: SaskNow Technologies [www.sasknow.com] MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Eric J. Schwertfeger wrote to Ryan Thompson: > On Mon, 17 Apr 2000, Ryan Thompson wrote: > > > I've recently begun mucking around with my bash prompts lately, and, due > > to the use of quite a lot of colour, PS1 has become quite long in > > characters (though, when displayed, is only about 15 columns, plus the > > path). > > put a \[ before and after the ANSI codes. Anything between them will not > get used to determine the length of the prompt, for word-wrapping > purposes. Ha! Thanks, Eric... Somehow that slipped by me. Actually, the end of the sequence should be marked with a \], not a \[. From the bash manpage: \[ begin a sequence of non-printing characters, which could be used to embed a terminal con- trol sequence into the prompt \] end a sequence of non-printing characters - Ryan -- Ryan Thompson Systems Administrator, Accounts Phone: +1 (306) 664-1161 SaskNow Technologies http://www.sasknow.com #106-380 3120 8th St E Saskatoon, SK S7H 0W2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message