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

Re: Job control missing nicety



Micah Elliott wrote:
> I'm used to being able to say 'fg -' in bash.  It's very quick to
> type.  In zsh I appear to have to say 'fg %-'.  But that's
> extremely tedious for me in comparison.  Is there a way to get
> 'fg -' to work in zsh?

fg() {
  if [[ $# -eq 1 && $1 = - ]]; then
    fg %-
  else
    builtin fg "$@"
  fi
}

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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