On 5/2/06, Beni Cherniavsky <[EMAIL PROTECTED]> wrote:
On 5/1/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> On 4/28/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> > Does anyone actually use %+ and %- in bash, i.e. the last and next to
> > last job to be used? 'fg' and 'bg' don't have to use %+, since running
> > 'fg' or 'bg' with no arguments will do the same thing, and I find it
> > easier to remember the job id of the current jobs than to remember
> > what job was second last to be used. Therefore, I've seen very little
> > reason to implement them, but I suppose different people might have
> > different tastes.
>
> I'll take that as a no. Excellent. One less feature! :-D
>
Wait, I do ;-).

Drats.

I don't care whether it will be called %- or $job_order[1] or (jobs -o
1) but I do want a way to access the order in which jobs were last
activated (launched or fg'd).
In bash I have "alias gf 'fg %-'" which is very handy for alternating
between 2 jobs; given the ordering of all jobs, it will be easy to
implement more sophisticated switching...

This can already be done with a bit of cleverness. The jobs builtin
outputs the jobs in activated order. That means you can get an array
of all jobs in activated order using:

set aj (jobs -g)

Which means that your 'gf' function can be written as:

function gf
 set aj (jobs -g)
 fg $aj[2]
end

Is that good enough? I'll admit it's not something you'd want to use
directly, as it's a bit too much to type, but in a script it should be
just fine.


Actually that's not what I really need.  Job control is a poor
solution in today's windowed environments.  What would be really nice
is for every suspended or backgrounded job to go to a new tab of the
terminal.
I'll check whether I can cook something up using 'dtach' and report back...

I can't see how one would do it without communicating with special
support from the terminal emulator, but it's a very good idea. It's
closely related to my occasional desire to use a tab interface to
navigate between windows in a screen session.


--
Beni Cherniavsky <[EMAIL PROTECTED]>, who can only read email on weekends.
Governments are like kernels - everything possible should be done in user space.


--
Axel


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to