zsh-users
 help / color / mirror / code / Atom feed
* My zshrc; any sugestions welcome
@ 2002-03-25 10:45 Marijan Peh
  2002-03-25 15:46 ` Bart Schaefer
  2002-03-26  0:06 ` Joakim Ryden
  0 siblings, 2 replies; 16+ messages in thread
From: Marijan Peh @ 2002-03-25 10:45 UTC (permalink / raw)
  To: zsh-users

It's 47k in size ... so you can find it on
http://free-po.hinet.hr/MarijanPeh/files/zshrc

Any sugestions welcome, thanks.

-- 
 .~.   marijan.peh@hi.hinet.hr
 /V\   /bin/zsh 4.1.0-dev-4 (i686-pc-linux-gnu)
/( )\  Linux nymos.home.hr 2.4.18-rmap-rml #3
^^ ^^


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

* Re: My zshrc; any sugestions welcome
  2002-03-25 10:45 My zshrc; any sugestions welcome Marijan Peh
@ 2002-03-25 15:46 ` Bart Schaefer
  2002-03-25 16:49   ` Adam Spiers
  2002-03-25 16:59   ` Marijan Peh
  2002-03-26  0:06 ` Joakim Ryden
  1 sibling, 2 replies; 16+ messages in thread
From: Bart Schaefer @ 2002-03-25 15:46 UTC (permalink / raw)
  To: Marijan Peh, zsh-users

On Mar 25, 11:45am, Marijan Peh wrote:
} 
} Any sugestions welcome, thanks.

Oh, what the heck, I've got half an hour to waste.

----------
## [[ ${+*} -eq 0 ]] = if variable is set don't set it anymore
[[ ${+USER} -eq 0 ]] && export USER=$USERNAME

You can write this as

(( ${+USER} )) || export USER=$USERNAME

Or even as

export USER=${USER:-$USERNAME}

----------
        ## display user@host and name of current process in (xterm|rxvt) title
        preexec () {print -Pn "\033]0;%n@%m [$1] %~\007"}

It'd probably be better to use ${${(z)1}[1]} there, rather than $1, if
you want just the command name.  Or even ${${${(z)1}:#*[[:punct:]]*}[1]}
in case the first "word" is an open-paren or something.

----------
        function compstyle { }

You meant `function zstyle { }', I'll bet.  It hasn't been called compstyle
for a while now.

----------
alias x='startx & disown && exit'

You can write that as

alias x='startx &! exit'

so that `disown' can't accidentally disown the wrong job.

----------
[in pskill()]

        kill -9 `print -r $pid`

Any reason why that isn't just `kill -9 $pid'?

----------
## invoke this every time when u change .zshrc to
## recompile it.
src()
{
        ! [ -f ~/.zshrc.zwc ] && zcompile ~/.zshrc
        ! [ -f ~/.zcompdump.zwc ] && zcompile ~/.zcompdump
        autoload zrecompile
        [ -f ~/.zshrc ] && zrecompile ~/.zshrc
        [ -f ~/.zcompdump ] && zrecompile ~/.zcompdump
        [ -f ~/.zshrc.zwc.old ] && rm -f ~/.zshrc.zwc.old
        [ -f ~/.zcompdump.zwc.old ] && rm -f ~/.zcompdump.zwc.old
        source ~/.zshrc
}

You should be able to get rid of those first two zcompile lines; just
change the two zrecompile lines to be:

	[ -f ~/.zshrc ] && zrecompile -p ~/.zshrc
        [ -f ~/.zcompdump ] && zrecompile -p ~/.zcompdump

----------
## restore all .bak files
## call this with something like: restore_bak 'find . -name "*.bak"'
restore_bak ()
{
        foreach f ($argv);
        mv $f ${f%%.bak};
        end
}

No problem with that (portability back to 3.0, etc.), but in 4.0:

autoload -U zmv
zmv '(**/)(*).bak' '$1$2'

----------
[in readme()]

In 4.0 with extendedglob you can write that files assignment as

	files=(./(#i)*(read*me|lue*m(in|)ut)*(ND))

----------
That's all.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: My zshrc; any sugestions welcome
  2002-03-25 15:46 ` Bart Schaefer
@ 2002-03-25 16:49   ` Adam Spiers
  2002-03-25 17:35     ` Marijan Peh
  2002-03-25 16:59   ` Marijan Peh
  1 sibling, 1 reply; 16+ messages in thread
From: Adam Spiers @ 2002-03-25 16:49 UTC (permalink / raw)
  To: zsh-users

Bart Schaefer (schaefer@brasslantern.com) wrote:
> On Mar 25, 11:45am, Marijan Peh wrote:
>         function compstyle { }
> 
> You meant `function zstyle { }', I'll bet.  It hasn't been called compstyle
> for a while now.

I think he pinched that (and a few other things) from an old version
of my .zshrc.  Recent copies appear at

  http://adamspiers.org/computing/zsh/files/.zshrc

and are gradually decreasing in naivety.


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

* Re: My zshrc; any sugestions welcome
  2002-03-25 15:46 ` Bart Schaefer
  2002-03-25 16:49   ` Adam Spiers
@ 2002-03-25 16:59   ` Marijan Peh
  2002-03-25 19:03     ` Bart Schaefer
  1 sibling, 1 reply; 16+ messages in thread
From: Marijan Peh @ 2002-03-25 16:59 UTC (permalink / raw)
  To: zsh-users

On Mon, Mar 25, 2002 at 03:46:21PM +0000, Bart Schaefer wrote:
> On Mar 25, 11:45am, Marijan Peh wrote:
> } 
> } Any sugestions welcome, thanks.
> 
> Oh, what the heck, I've got half an hour to waste.

:-)

>         ## display user@host and name of current process in (xterm|rxvt) title
>         preexec () {print -Pn "\033]0;%n@%m [$1] %~\007"}
> 
> It'd probably be better to use ${${(z)1}[1]} there, rather than $1, if
> you want just the command name.  Or even ${${${(z)1}:#*[[:punct:]]*}[1]}
> in case the first "word" is an open-paren or something.

This display just first letter of current running job. ex:
I run 'top' but is shows only 't' in titlebar.

>         function compstyle { }
> 
> You meant `function zstyle { }', I'll bet.  It hasn't been called compstyle
> for a while now.

Yes, missed that.

> [in pskill()]
> 
>         kill -9 `print -r $pid`
> 
> Any reason why that isn't just `kill -9 $pid'?

newlines (it can also go with `print -n $pid`) ex:

mpeh:~> ps x|grep top
1943 pts/6    S      0:00 top
mpeh:~> pskill to
killing to (process 1943
1953)...pskill:kill:5: illegal pid: 1943\n1953
slaughtered.

Thanks for cool tips.

Kind regards
Marijan Peh

-- 
 .~.   marijan.peh@hi.hinet.hr
 /V\   /bin/zsh 4.1.0-dev-4 (i686-pc-linux-gnu)
/( )\  Linux nymos.home.hr 2.4.18-rmap-rml #3
^^ ^^


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

* Re: My zshrc; any sugestions welcome
  2002-03-25 16:49   ` Adam Spiers
@ 2002-03-25 17:35     ` Marijan Peh
  0 siblings, 0 replies; 16+ messages in thread
From: Marijan Peh @ 2002-03-25 17:35 UTC (permalink / raw)
  To: zsh-users

On Mon, Mar 25, 2002 at 04:49:23PM +0000, Adam Spiers wrote:
> Bart Schaefer (schaefer@brasslantern.com) wrote:
> > On Mar 25, 11:45am, Marijan Peh wrote:
> >         function compstyle { }
> > 
> > You meant `function zstyle { }', I'll bet.  It hasn't been called compstyle
> > for a while now.
> 
> I think he pinched that (and a few other things) from an old version
> of my .zshrc.  Recent copies appear at
> 
>   http://adamspiers.org/computing/zsh/files/.zshrc
> 
> and are gradually decreasing in naivety.

Sorry, but i can't invent hot water.

Kind regards
Marijan Peh

-- 
 .~.   marijan.peh@hi.hinet.hr
 /V\   /bin/zsh 4.1.0-dev-4 (i686-pc-linux-gnu)
/( )\  Linux nymos.home.hr 2.4.18-rmap-rml #3
^^ ^^


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

* Re: My zshrc; any sugestions welcome
  2002-03-25 16:59   ` Marijan Peh
@ 2002-03-25 19:03     ` Bart Schaefer
  2002-03-26  9:38       ` Marijan Peh
  0 siblings, 1 reply; 16+ messages in thread
From: Bart Schaefer @ 2002-03-25 19:03 UTC (permalink / raw)
  To: Marijan Peh; +Cc: zsh-users

On Mon, 25 Mar 2002, Marijan Peh wrote:

> > It'd probably be better to use ${${(z)1}[1]} there, rather than $1, if
> > you want just the command name.  Or even ${${${(z)1}:#*[[:punct:]]*}[1]}
> > in case the first "word" is an open-paren or something.
>
> This display just first letter of current running job. ex:
> I run 'top' but is shows only 't' in titlebar.

Oh, sorry, in double quotes you need ${${(@)${(z)1}:#*[[:punct:]]*}[1]}
                                         ^^^

> >         kill -9 `print -r $pid`
> >
> > Any reason why that isn't just `kill -9 $pid'?
>
> newlines (it can also go with `print -n $pid`)

Ah.  You want

	kill -9 $=pid

> Thanks for cool tips.

Sure.


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

* Re: My zshrc; any sugestions welcome
  2002-03-25 10:45 My zshrc; any sugestions welcome Marijan Peh
  2002-03-25 15:46 ` Bart Schaefer
@ 2002-03-26  0:06 ` Joakim Ryden
  2002-03-26  1:17   ` Bart Schaefer
  1 sibling, 1 reply; 16+ messages in thread
From: Joakim Ryden @ 2002-03-26  0:06 UTC (permalink / raw)
  To: zsh-users

i thought i'd give it a try and it worked pretty well for me except:

jo.animal:~> src
/home/jo/.zshrc:133: compinit: function definition file not found

whereas just straight sourcing ~/.zshrc (not from the function)
works fine. i'm sure i'm overlooking something stupid. any ideas 
anyone??

--Jo

On Mon, Mar 25, 2002 at 11:45:08AM +0100, Marijan Peh wrote:
=> It's 47k in size ... so you can find it on
=> http://free-po.hinet.hr/MarijanPeh/files/zshrc
=> 
=> Any sugestions welcome, thanks.
=> 
=> -- 
=>  .~.   marijan.peh@hi.hinet.hr
=>  /V\   /bin/zsh 4.1.0-dev-4 (i686-pc-linux-gnu)
=> /( )\  Linux nymos.home.hr 2.4.18-rmap-rml #3
=> ^^ ^^
=> 


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

* Re: My zshrc; any sugestions welcome
  2002-03-26  0:06 ` Joakim Ryden
@ 2002-03-26  1:17   ` Bart Schaefer
  0 siblings, 0 replies; 16+ messages in thread
From: Bart Schaefer @ 2002-03-26  1:17 UTC (permalink / raw)
  To: Joakim Ryden; +Cc: zsh-users

On Mon, 25 Mar 2002, Joakim Ryden wrote:

> /home/jo/.zshrc:133: compinit: function definition file not found
>
> whereas just straight sourcing ~/.zshrc (not from the function)
> works fine. i'm sure i'm overlooking something stupid. any ideas
> anyone??

It's because `typeset -U path fpath ...' is executing inside the function
context and therefore turning all those arrays into local variables that
don't have their usual values.  I should have noticed this before.

There is no workaround for this using functions in zsh 3.0, so the `src'
function can't be used if the .zshrc is going to be read that version.
If only 4.0 will ever read it, you can change the call to typset to use
the -g option

	typeset -gU path fpath ...

and then all will be well.

Alternately, put the body of the `src' function in another file (called
for example `~/.zsh_reload') and then read *that* file with `source', e.g.

	alias src='source ~/.zsh_reload'


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

* Re: My zshrc; any sugestions welcome
  2002-03-25 19:03     ` Bart Schaefer
@ 2002-03-26  9:38       ` Marijan Peh
  2002-03-26 15:11         ` Bart Schaefer
  0 siblings, 1 reply; 16+ messages in thread
From: Marijan Peh @ 2002-03-26  9:38 UTC (permalink / raw)
  To: zsh-users

On Mon, Mar 25, 2002 at 11:03:11AM -0800, Bart Schaefer wrote:
> On Mon, 25 Mar 2002, Marijan Peh wrote:
> 
> > > It'd probably be better to use ${${(z)1}[1]} there, rather than $1, if
> > > you want just the command name.  Or even ${${${(z)1}:#*[[:punct:]]*}[1]}
> > > in case the first "word" is an open-paren or something.
> >
> > This display just first letter of current running job. ex:
> > I run 'top' but is shows only 't' in titlebar.
> 
> Oh, sorry, in double quotes you need ${${(@)${(z)1}:#*[[:punct:]]*}[1]}
>                                          ^^^

Nope, still the same.

-- 
 .~.   marijan.peh@hi.hinet.hr
 /V\   /bin/zsh 4.1.0-dev-4 (i686-pc-linux-gnu)
/( )\  Linux nymos.home.hr 2.4.18-rmap-rml #3
^^ ^^


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

* Re: My zshrc; any sugestions welcome
  2002-03-26  9:38       ` Marijan Peh
@ 2002-03-26 15:11         ` Bart Schaefer
  2002-03-26 16:46           ` Marijan Peh
  0 siblings, 1 reply; 16+ messages in thread
From: Bart Schaefer @ 2002-03-26 15:11 UTC (permalink / raw)
  To: Marijan Peh, zsh-users

On Mar 26, 10:38am, Marijan Peh wrote:
} Subject: Re: My zshrc; any sugestions welcome
}
} > > This display just first letter of current running job. ex:
} > > I run 'top' but is shows only 't' in titlebar.
} > 
} > Oh, sorry, in double quotes you need ${${(@)${(z)1}:#*[[:punct:]]*}[1]}
} >                                          ^^^
} 
} Nope, still the same.

Hmm, it works for me.  Show us your whole command line, again?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: My zshrc; any sugestions welcome
  2002-03-26 15:11         ` Bart Schaefer
@ 2002-03-26 16:46           ` Marijan Peh
  2002-03-26 17:10             ` Bart Schaefer
  0 siblings, 1 reply; 16+ messages in thread
From: Marijan Peh @ 2002-03-26 16:46 UTC (permalink / raw)
  To: zsh-users

On Tue, Mar 26, 2002 at 03:11:11PM +0000, Bart Schaefer wrote:
> On Mar 26, 10:38am, Marijan Peh wrote:
> } Subject: Re: My zshrc; any sugestions welcome
> }
> } > > This display just first letter of current running job. ex:
> } > > I run 'top' but is shows only 't' in titlebar.
> } > 
> } > Oh, sorry, in double quotes you need ${${(@)${(z)1}:#*[[:punct:]]*}[1]}
> } >                                          ^^^
> } 
> } Nope, still the same.
> 
> Hmm, it works for me.  Show us your whole command line, again?

preexec () {print -Pn "\033]0;%n@%m ${${(@)${(z)1}:#*[[:punct:]]*}[1]} %~\007"}

-- 
 .~.   marijan.peh@hi.hinet.hr
 /V\   /bin/zsh 4.1.0-dev-4 (i686-pc-linux-gnu)
/( )\  Linux nymos.home.hr 2.4.18-rmap-rml #3
^^ ^^


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

* Re: My zshrc; any sugestions welcome
  2002-03-26 16:46           ` Marijan Peh
@ 2002-03-26 17:10             ` Bart Schaefer
  2002-03-26 17:49               ` Marijan Peh
  2002-04-01 10:31               ` Marijan Peh
  0 siblings, 2 replies; 16+ messages in thread
From: Bart Schaefer @ 2002-03-26 17:10 UTC (permalink / raw)
  To: Marijan Peh, zsh-users

On Mar 26,  5:46pm, Marijan Peh wrote:
} Subject: Re: My zshrc; any sugestions welcome
}
} > } > > This display just first letter of current running job. ex:
} > } > > I run 'top' but is shows only 't' in titlebar.
} > 
} > Hmm, it works for me.  Show us your whole command line, again?
} 
} preexec () {print -Pn "\033]0;%n@%m ${${(@)${(z)1}:#*[[:punct:]]*}[1]} %~\007"}

Oh, silly me.  Single-element arrays are treated as scalars, so if the
command consists of only one word, you get only the first letter, but
if it consists of multiple words you get the first word.  I never tried
it with a command with no arguments.

So try this:

preexec () {
  print -Pn "\033]0;%n@%m ${${(@)${(z)1}:#*[[:punct:]]*}%% *} %~\007"
}

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: My zshrc; any sugestions welcome
  2002-03-26 17:10             ` Bart Schaefer
@ 2002-03-26 17:49               ` Marijan Peh
  2002-04-01 10:31               ` Marijan Peh
  1 sibling, 0 replies; 16+ messages in thread
From: Marijan Peh @ 2002-03-26 17:49 UTC (permalink / raw)
  To: zsh-users

On Tue, Mar 26, 2002 at 05:10:31PM +0000, Bart Schaefer wrote:
[cut]
> Oh, silly me.  Single-element arrays are treated as scalars, so if the
> command consists of only one word, you get only the first letter, but
> if it consists of multiple words you get the first word.  I never tried
> it with a command with no arguments.
> 
> So try this:
> 
> preexec () {
>   print -Pn "\033]0;%n@%m ${${(@)${(z)1}:#*[[:punct:]]*}%% *} %~\007"
> }

Yep, that's the right thing. Thnx

Kind regards
Marijan Peh

-- 
 .~.   marijan.peh@hi.hinet.hr
 /V\   /bin/zsh 4.1.0-dev-4 (i686-pc-linux-gnu)
/( )\  Linux nymos.home.hr 2.4.18-rmap-rml #3
^^ ^^


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

* Re: My zshrc; any sugestions welcome
  2002-03-26 17:10             ` Bart Schaefer
  2002-03-26 17:49               ` Marijan Peh
@ 2002-04-01 10:31               ` Marijan Peh
  2002-06-01  3:23                 ` Andy Spiegl
  1 sibling, 1 reply; 16+ messages in thread
From: Marijan Peh @ 2002-04-01 10:31 UTC (permalink / raw)
  To: zsh-users

On Tue, Mar 26, 2002 at 05:10:31PM +0000, Bart Schaefer wrote:
> Oh, silly me.  Single-element arrays are treated as scalars, so if the
> command consists of only one word, you get only the first letter, but
> if it consists of multiple words you get the first word.  I never tried
> it with a command with no arguments.
> 
> So try this:
> 
> preexec () {
>   print -Pn "\033]0;%n@%m ${${(@)${(z)1}:#*[[:punct:]]*}%% *} %~\007"
> }

I just now noticed that it's not working for 'two_or_more' word job ex.
If i run 'vi .Xresources .vimrc .slrnrc' it only shows 'vi' in titlebar.
With '$1' it works perfectly? (shows complete line).
Why is $1 bad?

-- 
 .~.   marijan.peh@hi.hinet.hr
 /V\   /bin/zsh 4.1.0-dev-4 (i686-pc-linux-gnu)
/( )\  Linux nymos.home.hr 2.4.18-rmap-rml #4
^^ ^^


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

* Re: My zshrc; any sugestions welcome
  2002-04-01 10:31               ` Marijan Peh
@ 2002-06-01  3:23                 ` Andy Spiegl
  2002-06-01 21:29                   ` Bart Schaefer
  0 siblings, 1 reply; 16+ messages in thread
From: Andy Spiegl @ 2002-06-01  3:23 UTC (permalink / raw)
  To: zsh-users

Hi Marijan,

> > preexec () {
> >   print -Pn "\033]0;%n@%m ${${(@)${(z)1}:#*[[:punct:]]*}%% *} %~\007"
> > }
> 
> I just now noticed that it's not working for 'two_or_more' word job ex.
> If i run 'vi .Xresources .vimrc .slrnrc' it only shows 'vi' in titlebar.
Right, that's bothering me right now, too.

> With '$1' it works perfectly? (shows complete line).
> Why is $1 bad?
First I didn't understand it either, then I stumbled over more complicated
command lines with quotes and stuff in it.  For example, try:

 echo hi | perl -ne 'print "oops\n"'

This should just print:
 oops
but with <$1> in preexec it prints:
 
 "'>" pts/17 ~oops

I'd really get it to work the way you tried, but I can't figure it out. :-(
Any suggestions anyone?

Thanks,
 Andy.

-- 
           http://peru.spiegl.de  Our project
      http://radiomaranon.org.pe  Radio Marañón, Jaén, Perú
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Do files get embarrassed when they get unzipped?


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

* Re: My zshrc; any sugestions welcome
  2002-06-01  3:23                 ` Andy Spiegl
@ 2002-06-01 21:29                   ` Bart Schaefer
  0 siblings, 0 replies; 16+ messages in thread
From: Bart Schaefer @ 2002-06-01 21:29 UTC (permalink / raw)
  To: Andy Spiegl, zsh-users

On May 31, 10:23pm, Andy Spiegl wrote:
} Subject: Re: My zshrc; any sugestions welcome
}
} Hi Marijan,
} 
} > > preexec () {
} > >   print -Pn "\033]0;%n@%m ${${(@)${(z)1}:#*[[:punct:]]*}%% *} %~\007"
} > > }
} > 
} > I just now noticed that it's not working for 'two_or_more' word job ex.
} 
} Right, that's bothering me right now, too.

The function as quoted is designed to show only the command name.

The ${...%% *} in the expression above strips off everything after the
first word.  Inside that, ${(@)...:#*[[:punct:]]*} removes all words that
contain punctuation (which would include file names with dots in them).

The intent was that, if for example you give a command such as

    CVS_RSH=ssh cvs update 
or
    ( scp some list of files remote:directory )

the variable assignments and parentheses will be discarded before figuring
out what command name to display.

} > With '$1' it works perfectly? (shows complete line).
} > Why is $1 bad?
} First I didn't understand it either, then I stumbled over more complicated
} command lines with quotes and stuff in it.

The real danger is that the command line will contain a control character
or the like which the terminal interprets, or (as in your next example)
that it will contain a backslash sequence like \n which `print' will turn
into something unwanted.

A secondary problem is that the command line may be much longer than you
really want to put into your title bar.  What if the command is a multi-
line `for' or `while' loop?

} For example, try:
} 
}  echo hi | perl -ne 'print "oops\n"'
} 
} This should just print:
}  oops
} but with <$1> in preexec it prints:
}  
}  "'>" pts/17 ~oops

This happens because the \n in "oops\n" gets turned into a real newline
by `print -nP', and the newline terminates the title bar string the same
way that the \007 would have.  A similar thing would happen if the command
contained an actual newline, such as a multi-line loop body would.

} I'd really get it to work the way you tried, but I can't figure it out. :-(
} Any suggestions anyone?

If you have zsh 4.0.x, you might try:

    preexec () {
      print -Pn "\033]0;%n@%m ${(Vq)2} %~\007"
    }

The doc for preexec says "the second argument is a single-line, size-
limited version of the command (with things like function bodies elided)".
The (Vq) means to render any control characters in a visible format and
to quote any special characters in the string with backslashes.

There isn't any simple way to get the equivalent in 3.x.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

end of thread, other threads:[~2002-06-01 21:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-25 10:45 My zshrc; any sugestions welcome Marijan Peh
2002-03-25 15:46 ` Bart Schaefer
2002-03-25 16:49   ` Adam Spiers
2002-03-25 17:35     ` Marijan Peh
2002-03-25 16:59   ` Marijan Peh
2002-03-25 19:03     ` Bart Schaefer
2002-03-26  9:38       ` Marijan Peh
2002-03-26 15:11         ` Bart Schaefer
2002-03-26 16:46           ` Marijan Peh
2002-03-26 17:10             ` Bart Schaefer
2002-03-26 17:49               ` Marijan Peh
2002-04-01 10:31               ` Marijan Peh
2002-06-01  3:23                 ` Andy Spiegl
2002-06-01 21:29                   ` Bart Schaefer
2002-03-26  0:06 ` Joakim Ryden
2002-03-26  1:17   ` Bart Schaefer

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