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

Re: fg jobs info



On Sep 3,  3:43am, Atom Smasher wrote:
}
} why i want this: i've tweaked my ~/.zshrc file to fill in the tabs of 
} mrxvt (and the windowlist in screen) with the current command name (and 
} some other goodies, i'll post the rc file if there's interest). ie; i can 
} quickly find the 'emacs somefile' tab (or screen) because the tab (or 
} screen) says "emacs somefile". cool. but if i suspend the command, then 
} bring it back with 'fg', the tab (or screen) now says "fg". not cool.

Have a look at the variables jobdirs, jobtexts, and jobstates in the
zsh/parameter module.  Or there's a lazier way out:

} unless there's a way to simulate the fg command (ie; a "-n" dry run 
} argument)

The "jobs" command should accept all the same job-identifier patterns
as "fg", and in recent zsh "jobs" doesn't lose track of the job list
when run in a subshell, so you can do things like

    fg() {
	# Obviously this needs error handling added, etc.
    	typeset -g fgjob=$(jobs $*)
	builtin fg $*
    }

and then stuff the title bar (or whatever) with the something parsed
out of $fgjob.



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