zsh-workers
 help / color / mirror / code / Atom feed
* preexec problems
@ 2015-06-22  5:53 Dave Yost
  2015-06-22  6:00 ` Mikael Magnusson
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Yost @ 2015-06-22  5:53 UTC (permalink / raw)
  To: zsh workers

[-- 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%         



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: preexec problems
  2015-06-22  5:53 preexec problems Dave Yost
@ 2015-06-22  6:00 ` Mikael Magnusson
  2015-06-23  3:55   ` Dave Yost
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Magnusson @ 2015-06-22  6:00 UTC (permalink / raw)
  To: Dave Yost; +Cc: zsh workers

On Mon, Jun 22, 2015 at 7:53 AM, Dave Yost <Dave@yost.com> wrote:
> It occurred to me that using the preexec hook, I could get the command line to be in another color.

You should occur to use zle_highlight instead. For example;
    zle_highlight=(region:underline
                   special:bold,bg=black
                   default:fg=39
                  )


-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: preexec problems
  2015-06-22  6:00 ` Mikael Magnusson
@ 2015-06-23  3:55   ` Dave Yost
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Yost @ 2015-06-23  3:55 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: zsh workers

Thanks!

Now if I could get zsh to intercept stderr and output it with its own color, I would be in zheaven!

> On 2015-06-21, at 11:00 PM, Mikael Magnusson <mikachu@gmail.com> wrote:
> 
> On Mon, Jun 22, 2015 at 7:53 AM, Dave Yost <Dave@yost.com> wrote:
>> It occurred to me that using the preexec hook, I could get the command line to be in another color.
> 
> You should occur to use zle_highlight instead. For example;
>    zle_highlight=(region:underline
>                   special:bold,bg=black
>                   default:fg=39
>                  )
> 
> 
> -- 
> Mikael Magnusson


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-23  3:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-22  5:53 preexec problems Dave Yost
2015-06-22  6:00 ` Mikael Magnusson
2015-06-23  3:55   ` Dave Yost

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).