* Suspending an interactive job: Zsh vs Bash differences
@ 2008-01-11 18:37 Robert McLay
2008-01-11 20:52 ` Dan Nelson
2008-01-11 21:06 ` Peter Stephenson
0 siblings, 2 replies; 5+ messages in thread
From: Robert McLay @ 2008-01-11 18:37 UTC (permalink / raw)
To: zsh-users
I am a recent convert from bash to zsh and am very happy with just about every
thing in zsh. There is a difference in Zsh that I miss from my bash days.
It is in suspending a job. Under bash (currently: version 3.2.25(1)-release)
when I suspend an interactive program I get:
bash$ emacs # typed ^Z
[1]+ Stopped emacs
Under Zsh I get:
zsh% emacs # typed ^Z
zsh: suspended emacs
So namely I'm missing the job number. It is correctly reported by jobs:
zsh% jobs
[1] + suspended emacs
What I would like is the job number reported when the interactive program
is '^Z'. I have aliased 'kill1' to be "kill -9 %1' and 'kill2' to
be "kill -9 %2' and so on. This way I could (under bash) '^Z' a program and
type 'kill#' where '#' is the job number. I don't care how the job number
is included so as a guess, I'd merge the 'jobs' output with '^Z' like this:
zsh: [#] +/- suspended job_name
Where [#] is the job number and the +/- marks just like 'jobs' does. So
zsh% emacs # typed ^Z
zsh: [1] + suspended emacs
would be something like what I'm looking for.
Is this an easy or difficult change? Maybe there is a way to modify what '^Z'
is bound to?
Thanks,
R.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Suspending an interactive job: Zsh vs Bash differences
2008-01-11 18:37 Suspending an interactive job: Zsh vs Bash differences Robert McLay
@ 2008-01-11 20:52 ` Dan Nelson
2008-01-11 21:06 ` Peter Stephenson
1 sibling, 0 replies; 5+ messages in thread
From: Dan Nelson @ 2008-01-11 20:52 UTC (permalink / raw)
To: Robert McLay; +Cc: zsh-users
In the last episode (Jan 11), Robert McLay said:
> I am a recent convert from bash to zsh and am very happy with just
> about every thing in zsh. There is a difference in Zsh that I miss
> from my bash days.
>
> It is in suspending a job. Under bash (currently: version
> 3.2.25(1)-release) when I suspend an interactive program I get:
>
> bash$ emacs # typed ^Z
>
> [1]+ Stopped emacs
>
> Under Zsh I get:
>
> zsh% emacs # typed ^Z
>
> zsh: suspended emacs
>
> So namely I'm missing the job number. It is correctly reported by jobs:
>
> zsh% jobs
> [1] + suspended emacs
Try setting the longlistjobs option, which gives you the job number
plus the pid as a bonus:
dan% sleep 10
^Z
zsh: suspended sleep 10
dan% kill %1
[1] + terminated sleep 10
dan% setopt longlistjobs
dan% sleep 10
^Z
[1] + 49470 suspended sleep 10
--
Dan Nelson
dnelson@allantgroup.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Suspending an interactive job: Zsh vs Bash differences
2008-01-11 18:37 Suspending an interactive job: Zsh vs Bash differences Robert McLay
2008-01-11 20:52 ` Dan Nelson
@ 2008-01-11 21:06 ` Peter Stephenson
2008-01-12 2:00 ` Bart Schaefer
2008-01-18 21:19 ` Richard Hartmann
1 sibling, 2 replies; 5+ messages in thread
From: Peter Stephenson @ 2008-01-11 21:06 UTC (permalink / raw)
To: zsh-users
On Fri, 11 Jan 2008 12:37:07 -0600
Robert McLay <mclay@zaniahgroup.com> wrote:
> Under Zsh I get:
>
> zsh% emacs # typed ^Z
>
> zsh: suspended emacs
>
> So namely I'm missing the job number.
You just need to "setopt longlistjobs". I'm not sure why it's not the
default.
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Suspending an interactive job: Zsh vs Bash differences
2008-01-11 21:06 ` Peter Stephenson
@ 2008-01-12 2:00 ` Bart Schaefer
2008-01-18 21:19 ` Richard Hartmann
1 sibling, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2008-01-12 2:00 UTC (permalink / raw)
To: zsh-users
On Jan 11, 9:06pm, Peter Stephenson wrote:
}
} You just need to "setopt longlistjobs". I'm not sure why it's not the
} default.
Because most of the interactive defaults are intended to make zsh more
like (t)csh and less like anything /bin/sh-ish.
Or at least that's true of the options that have been around for 20+ years.
Newer options might not fit that description.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Suspending an interactive job: Zsh vs Bash differences
2008-01-11 21:06 ` Peter Stephenson
2008-01-12 2:00 ` Bart Schaefer
@ 2008-01-18 21:19 ` Richard Hartmann
1 sibling, 0 replies; 5+ messages in thread
From: Richard Hartmann @ 2008-01-18 21:19 UTC (permalink / raw)
To: Peter Stephenson; +Cc: zsh-users
Resend as I fail to send mail to lists that do not munge reply-to.
On Jan 11, 2008 10:06 PM, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> You just need to "setopt longlistjobs". I'm not sure why it's not the
> default.
Defaulting to this would sense, imo.
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-01-18 21:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-11 18:37 Suspending an interactive job: Zsh vs Bash differences Robert McLay
2008-01-11 20:52 ` Dan Nelson
2008-01-11 21:06 ` Peter Stephenson
2008-01-12 2:00 ` Bart Schaefer
2008-01-18 21:19 ` Richard Hartmann
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).