From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7430 invoked from network); 30 Jan 1997 23:28:26 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 30 Jan 1997 23:28:26 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id SAA26927; Thu, 30 Jan 1997 18:22:46 -0500 (EST) Resent-Date: Thu, 30 Jan 1997 18:11:44 -0500 (EST) From: Will Day Message-Id: <199701302313.SAA12620@rom.oit.gatech.edu> Subject: problem with bold prompt To: zsh-users@math.gatech.edu (zsh users mailing list) Date: Thu, 30 Jan 1997 18:13:25 -0500 (EST) Reply-To: willday@rom.oit.gatech.edu (Will Day) X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"6oNZ62.0.TO6.lgIyo"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/638 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- This is a problem I've been fighting with for a long time, and which I only recently began to grasp, when it got worse after I upgraded from 2.5.03 to 3.0.2. :) My prompt is defined as: export PS1="^[[1m${HOSTNAME}:^[[m%d) " so that it appears as: rom:/home/willday) where the "rom" is bold. It looks like zsh is counting the formatting characters as printable characters on the command-line. Under 2.5.03, this would screw up command-recall, and ctrl-U line clearing. For instance, at the prompt (where # indicates the location of the cursor): rom:/home/willday/src/done/zsh-2.5.03) # hitting "ESC /" would move the cursor over seven characters: rom:/home/willday/src/done/zsh-2.5.03) # / which corresponds to the seven non-printable characters in my prompt (^[,[,1,m,^[,[,m). Lines recalled with "/" would be printed at the 7-char offset: rom:/home/willday/src/done/zsh-2.5.03) ls -dlF INSTALL README doc etc examples help src Lines recalled with just "ESC -" would not be offset, but command-line editing would be screwed up. For instance, "ESC - b b b b" should bring up the line, and go back 4 words, placing the cursor at "etc". Instead, it ends up 7 chars off, in the middle of "example": rom:/home/willday/src/done/zsh-2.5.03) ls -dlF INSTALL README doc etc exa#ple s help src Under 3.0.2, it now also clears the line and starts overwriting when I reach the right margin. For instance, a line that should look like this: rom:/home/willday/src/done/zsh-3.0.2) ls -dlF INSTALL README Doc Etc Misc Src Util ends up looking like this: isc Src Util which makes it most unusable. It doesn't seem to matter what terminal type I'm using (xterm, mac vt100, linux console), nor which formatting codes I use (^[[34m for blue, etc), but the offset does always correspond to the number of non-printable characters in the prompt. I managed to hack 3.0.2's zle_refresh.c to behave like 2.0.5 did in this regard (that is, not to clear the line), so at least it's now usable again. :) But I don't know enough about the code to go in and fix the problem. ______________________________________________________________________________ Will Day OIT, Georgia Tech, Atlanta 30332-0715 willday@rom.oit.gatech.edu http://rom.oit.gatech.edu/~willday/ =-> Opinions expressed are mine alone and do not reflect OIT policy <-= Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. Benjamin Franklin, Pennsylvania Assembly, Nov. 11, 1755 -----BEGIN PGP SIGNATURE----- Version: 2.6.3a Charset: noconv Comment: http://rom.oit.gatech.edu/~willday/pubkey.asc iQCVAwUBMvEq+BDHlOdPw2ZdAQFTKgP/eQUjR/8aqE9jXpZrIAeAaZIqy23IFlOO iflYxFPgIyLxTLiccxDeI2cYvzOwElMLXyfzhe11rydSpTUvhAtxyrf2b0YKy2Lu YPFAqKAgZ5oH7oRCHNHqepDDfHWKMakWIHSoLxfpJgm2j2JstGsdIPEEBEahFhly T9T+r0CCMjc= =O+wh -----END PGP SIGNATURE-----