On 4/23/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> On 4/22/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> > On 4/22/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> > > On 4/21/06, ray hammond <[EMAIL PROTECTED]> wrote:
> > > [...]
> > > > fg %1
> > > >
> > > > I then received the following:
> > > >
> > > > Send job 1, 'fg %1' to foreground
> > > > fish: Could not send job 1 ('fg %1') to foreground
> > > > tcsetpgrp: Operation not permitted
> > > >
> > > > The prompt then froze and I had to terminate my shell.  I attempted the 
> > > > same
> > > > sequence of events in a bash shell.  Vi resumed operation without any
> > > > problems.
> > >
> > > There are two separate issues.  The error message occurs because Fish
> > > currently indexes jobs from 0, and there is no job 1.  So you should
> > > type "fg" or "fg %0".  You can list the jobs using the "jobs" command.
> > >
> > > I would think that Fish should index jobs from 1 -- to be more
> > > consistent with array indexing in Fish and job indexing in POSIX
> > > shell, and for the same arguments as indexing arrays from 1.
> >
> > Never, though about it, but indexing from 1 makes more sense since
> > fish indexes arrays from one. If other shells index jobs from 1, then
> > there really is _no_ reason not to do the same. Will change, but not
> > before 1.21.6, since I want to get that one out the door.
> >
> > Note though that you can either simply use 'fg' to put the last job to
> > be manipulated by job control in the foreground, or e.g. 'fg %vi' to
> > put vi into the foreground.
> >
> > >
> > > The second issue is apparently a bug in Fish that prevents sending
> > > some terminal programs to the foreground,  for example "man" or "vi"
> > > but not "xterm", "links", "w3m", "yes" or "tail".
> >
> > I can put both vi and man into the foreground just fine. Can you give
> > me a reproducible test case?
>
> Sorry, that was the behavior with Fish 1,20.1.  My apologies.
>
> Fish 1.21.6 seems to freeze only if I try to return to job n when
> there is no job n:
>
> fish> jobs
> Job     Group   CPU     State   Command
> 0       28475   0%      stopped man man
> 1       28666   0%      stopped less hello.txt
> fish> fg %2
> Send job 2, 'fg %2' to foreground
> fish: Could not send job 2 ('fg %2') to foreground
> tcsetpgrp: Operation not permitted
>
> [Fish freezes.]

Oopsie. I can reproduce this. Will look into it.

>
> It seems that Fish tries to send the job "fg %2" to the foreground and fails.
>
> On a related note, is there a way to specify a job by name (like
> "%man") when the command name is ambiguous (both "man ls" and "man
> man" are in the background)?  There should be a way to disambiguate
> the name, no?  Like "fg %'man ls'" or "fg %man ls"?

'echo %man\ ls' works. 'echo man %"man ls"' does not work with the
motivation that 'echo $"PWD"' doesn't work. Maybe they both should?

>
> Also, I'm curious -- why did you decide to make "jobs" print a message
> when there are no jobs?  I think it should print nothing.
>

It only prints that message when stdout is a terminal. Which if I know
you correctly will be considered even worse, since it introduces
modality.

The motivation, which is a bit shaky, goes something like this:

When used interactively, one wants 'jobs' to output a header column,
since there is too much information to grok what is what by simply
looking at the output. When used in a script, we want to skip this
header, since we'll simply have to remove it manually anyway. This is
strongly related to how e.g. 'ls' and 'mysql' outputs listings in
different formats depending on whether stdout is a terminal or not.
What this amounts to, is that I feel it is ok for commands to have
different output formats in scripts. Yes it _is_ confusing, but it is
very common, so users should be used to it, and it is also very
convenient.

Thus, we have lost our modelessness, and therefore I see no great
crime in increasing the difference between interactive and script
output of 'jobs' if it makes sense. It is pretty obvious that we do
_not_ want a 'no jobs' message when running 'jobs' in a script, so
there isn't one. When running jobs in interactive mode, it makes at
least a bit of sense - I am generally untrusting when it comes to
computers. If I ask the computer something, and it gives me _nothing_
in response, I'll have some sneaking suspicion that the computer
didn't understand what I asked it. I want the computer to explicitly
tell me 'I have nothing to say to you, now go away'.

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