zsh-workers
 help / color / mirror / code / Atom feed
From: Dave Yost <Dave@Yost.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: preexec problems
Date: Sun, 21 Jun 2015 22:53:32 -0700	[thread overview]
Message-ID: <0C266C66-4788-4C62-BDF8-1E011884EFC1@yost.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

It occurred to me that using the preexec hook, I could get the command line to be in another color.

However, there are some bugs. The white command line characters below come about from using tab completion.

0 Sun 22:48:55 yost DaveBook ~
203 Z% cd /tmp
0 Sun 22:49:02 yost DaveBook /tmp
204 Z% mkdir -p  a/b/c/d
0 Sun 22:49:10 yost DaveBook /tmp
205 Z% ls a/b/c/d 
0 Sun 22:49:17 yost DaveBook /tmp
206 Z% 

0 Sun 22:50:55 yost DaveBook /tmp/a
210 Z% mkdir 1 2 3 4 5 6
0 Sun 22:51:06 yost DaveBook /tmp/a
211 Z% ls         ls
1/  2/  3/  4/  5/  6/  b/

This last problem was from typing “ls” and then tab. And it gets worse if you try to backspace.

Here is an easy way to reproduce this:

Z% PS1="$PS1%B"                         
Z% function preexec { echo -n '\e[39m' }
Z% echo yea
yea
Z% ls a/b/c/d 
Z% ls a/b/c 
d
Z%         



             reply	other threads:[~2015-06-22  5:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22  5:53 Dave Yost [this message]
2015-06-22  6:00 ` Mikael Magnusson
2015-06-23  3:55   ` Dave Yost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C266C66-4788-4C62-BDF8-1E011884EFC1@yost.com \
    --to=dave@yost.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).