zsh-users
 help / color / mirror / code / Atom feed
* Contrl-Z action.
@ 1996-11-05 10:46 Alexey Solovyov
  1996-11-06  1:39 ` Kosh
  1996-11-06  2:58 ` Geoff Wing
  0 siblings, 2 replies; 5+ messages in thread
From: Alexey Solovyov @ 1996-11-05 10:46 UTC (permalink / raw)
  To: zsh-users

Hi, guys,

It seems to me that the mailing lists are not very popular among zsh
guys. Or we really have nothing to talk about? 

But I've got a question. Once I came up why I want to have my job
suspended by pressing Cntrl-Z ? Ok, I want it to run in background
right after that. In another words how to (where) redefine action of
Ctrl-Z?  Any comments why nobody should change it are also very
welcome.

All the best,
----------------------------------------------------------------------
Alexey A. Solovyov
<alekso@math.ucr.edu>
<alekso@math.uu.se>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Contrl-Z action.
  1996-11-05 10:46 Contrl-Z action Alexey Solovyov
@ 1996-11-06  1:39 ` Kosh
  1996-11-06  2:58 ` Geoff Wing
  1 sibling, 0 replies; 5+ messages in thread
From: Kosh @ 1996-11-06  1:39 UTC (permalink / raw)
  To: Alexey Solovyov; +Cc: zsh-users

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=US-ASCII, Size: 949 bytes --]

On Tue, 5 Nov 1996, Alexey Solovyov wrote:

> Hi, guys,
> 
> It seems to me that the mailing lists are not very popular among zsh
> guys. Or we really have nothing to talk about? 
> 
> But I've got a question. Once I came up why I want to have my job
> suspended by pressing Cntrl-Z ? Ok, I want it to run in background
> right after that. In another words how to (where) redefine action of
> Ctrl-Z?  Any comments why nobody should change it are also very
> welcome.

Ctrl-Z "suspends" the job.  For job control, use:

ps, jobs, bg, fg

commands to move around. :)
Take a look at these... They're quite useful (at least for me... I use it
everyday :P   ).

--
 Sirius Bontea, E-3
-=ðUnited States Air Forceð=-
Email:   <mariah@isis.interpac.net>
Web page:   http://home.interpac.net/~mariah/index.html
IRC:  ]{osh@EfNet  on  #Mariah  =)
Administrator of the Mariah Carey Marketplace.
==== For more details,  'finger mariah@isis.interpac.net' ====


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Contrl-Z action.
  1996-11-05 10:46 Contrl-Z action Alexey Solovyov
  1996-11-06  1:39 ` Kosh
@ 1996-11-06  2:58 ` Geoff Wing
  1996-11-06  4:49   ` Alexey Solovyov
  1 sibling, 1 reply; 5+ messages in thread
From: Geoff Wing @ 1996-11-06  2:58 UTC (permalink / raw)
  To: Alexey Solovyov; +Cc: zsh-users

Alexey Solovyov wrote:
:guys. Or we really have nothing to talk about? 
:
:But I've got a question. Once I came up why I want to have my job
:suspended by pressing Cntrl-Z ? Ok, I want it to run in background
:right after that. In another words how to (where) redefine action of
:Ctrl-Z?  Any comments why nobody should change it are also very
:welcome.

I can't think of a elegant way of doing this automatically without a lot of
overhead.  What you could do is

% bindkey -s "^Z" "bg^M"

then when you suspend something, press CTRL-Z again and it will put it in the
background.
-- 
Geoff Wing [gwing@primenet.com.au]   Technical Manager
  Phone    : +61-3-9818 2977	     PrimeNet - Internet Consultancy
  Facsimile: +61-3-9819 3788	     Web : <URL:http://www.primenet.com.au/>
  Mobile   : 0412 162 441


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Contrl-Z action.
  1996-11-06  2:58 ` Geoff Wing
@ 1996-11-06  4:49   ` Alexey Solovyov
  1996-11-06  8:48     ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Solovyov @ 1996-11-06  4:49 UTC (permalink / raw)
  To: Geoff Wing; +Cc: alekso, zsh-users

> :But I've got a question. Once I came up why I want to have my job
> :suspended by pressing Cntrl-Z ? Ok, I want it to run in background
> :right after that. In another words how to (where) redefine action of
> :Ctrl-Z?  Any comments why nobody should change it are also very
> :welcome.
> 
> I can't think of a elegant way of doing this automatically without a lot of
> overhead.  What you could do is
> 
> % bindkey -s "^Z" "bg^M"
> 
> then when you suspend something, press CTRL-Z again and it will put it in the
> background.

Thanks, I will probably do it this way though actually I was thinking
about changing the sources... :)

But anyway suggestions about eliminating the second Ctrl-Z are welcome.

----------------------------------------------------------------------
Alexey A. Solovyov
<alekso@math.ucr.edu>
<alekso@math.uu.se>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Contrl-Z action.
  1996-11-06  4:49   ` Alexey Solovyov
@ 1996-11-06  8:48     ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 1996-11-06  8:48 UTC (permalink / raw)
  To: Alexey Solovyov, Geoff Wing, zsh-users

On Nov 5,  8:49pm, Alexey Solovyov wrote:
} Subject: Re: Contrl-Z action.
}
} > :But I've got a question. Once I came up why I want to have my job
} > :suspended by pressing Cntrl-Z ? Ok, I want it to run in background
} > :right after that.
} > 
} > I can't think of a elegant way of doing this automatically without a
} > lot of overhead.
} 
} Thanks, I will probably do it this way though actually I was thinking
} about changing the sources... :)

Eww, don't do that.

} But anyway suggestions about eliminating the second Ctrl-Z are welcome.

    function autobg() {
	jobs -s >| /tmp/j$$
	while read jnum jdesc
	do
	    bg %${${jnum#\[}%\]}
	done < /tmp/j$$
	rm -f /tmp/j$$
    }

    function precmd() {
	autobg
    }

I really question whether this is the behavior you want, though.  You
might want to change the `bg ...' command in autobg to something like

	case $jdesc in
	(*( vi | vim | *emacs )*) ;;	# Don't autobg any editors,
	(*) bg %${${jnum#\[}%\]} ;;	# but anything else is OK.
	esac

or possibly something even more restrictive where you list the things
that you *do* want to autobg rather than those that you don't.

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-11-06  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-05 10:46 Contrl-Z action Alexey Solovyov
1996-11-06  1:39 ` Kosh
1996-11-06  2:58 ` Geoff Wing
1996-11-06  4:49   ` Alexey Solovyov
1996-11-06  8:48     ` Bart Schaefer

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