Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

precmd() affecting the "r" command output



Hi,

I'm using the precmd() special function to print the current directory
and the hostname in the title bar of my xterms.  But doing this, the
output of the r command (executing again the last command) is affected
in a unexpected and unwanted way - I guess.

  1> which precmd
  precmd not found
  2> locate foobar
  /usr/TeX/texmf-dist/doc/latex/examdesign/foobar.tex
  3> less `r`
  locate foobar
  4> precmd () {
  function> print -Pn "\e]0;[ %n@%m: %~ ]\a" 
  function> }
  5> locate foobar
  /usr/TeX/texmf-dist/doc/latex/examdesign/foobar.tex
  6> less `r`
  locate foobar

  test@matamore:: No such file or directory
  /home/noirel is a directory
  ]/usr/TeX/texmf-dist/doc/latex/examdesign/foobar.tex: No such file or
  directory
  7> 

precmd() is supposed to be executed once before each prompt (according
to the man page) but here it is executed one more time, when "r" is
executed.  I think that either the behaviour or the man page is
wrong and should therefore be corrected.

Thank you for your time (and for zsh of course),

-- 
Josselin Noirel



Messages sorted by: Reverse Date, Date, Thread, Author