zsh-users
 help / color / mirror / code / Atom feed
* DIY ZSH
@ 2015-03-11 21:22 zzapper
  2015-03-11 23:15 ` toki clover
  2015-03-12  9:07 ` lilydjwg
  0 siblings, 2 replies; 10+ messages in thread
From: zzapper @ 2015-03-11 21:22 UTC (permalink / raw)
  To: zsh-users

Hi
I believe that you can extend zsh by writing your own modules functions 
etc.
But how many of you are actually doing this and what sort of things are you 
doing?

-- 
zzapper
https://twitter.com/dailyzshtip

---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



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

* Re: DIY ZSH
  2015-03-11 21:22 DIY ZSH zzapper
@ 2015-03-11 23:15 ` toki clover
  2015-03-12  8:31   ` Axel Beckert
  2015-03-12  9:07 ` lilydjwg
  1 sibling, 1 reply; 10+ messages in thread
From: toki clover @ 2015-03-11 23:15 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 55 bytes --]

Take a look at oh-my-zhs[1] or prezto[2] on github.com

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

* Re: DIY ZSH
  2015-03-11 23:15 ` toki clover
@ 2015-03-12  8:31   ` Axel Beckert
  2015-03-12 18:46     ` ZyX
  0 siblings, 1 reply; 10+ messages in thread
From: Axel Beckert @ 2015-03-12  8:31 UTC (permalink / raw)
  To: zsh-users

Hi,

On Thu, Mar 12, 2015 at 12:15:34AM +0100, toki clover wrote:
> zzapper wrote:
> > I believe that you can extend zsh by writing your own modules
> > functions etc. But how many of you are actually doing this and
> > what sort of things are you doing?
>
> Take a look at oh-my-zhs[1] or prezto[2] on github.com

At least omz is just a bunch of (z)shell code, no C code involved. And
after a short search for prezto on github, it seems to be just yet
another "zsh configuration framework". So I don't expect C code to be
involved either.

But as I understood zzapper, he actually meant writing stuff in C, at
least "writing modules" implies that AFAIK.

IIRC there was recently a thread on one of the zsh mailing lists about
zpython, which embeds the python interpreter into zsh or similar:
https://github.com/YaroslavLitvinov/zpython

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)


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

* Re: DIY ZSH
  2015-03-11 21:22 DIY ZSH zzapper
  2015-03-11 23:15 ` toki clover
@ 2015-03-12  9:07 ` lilydjwg
  2015-03-12 21:51   ` zzapper
  2015-03-13  3:59   ` Bart Schaefer
  1 sibling, 2 replies; 10+ messages in thread
From: lilydjwg @ 2015-03-12  9:07 UTC (permalink / raw)
  To: zsh-users

On Wed, Mar 11, 2015 at 09:22:38PM +0000, zzapper wrote:
> Hi
> I believe that you can extend zsh by writing your own modules functions 
> etc.
> But how many of you are actually doing this and what sort of things are you 
> doing?

I've written a simple zsh module to call

prctl(PR_SET_CHILD_SUBREAPER, reaping);

so that orphaned subprocesses won't get adopted by farther processes
(e.g. init) when the shell is still there. It requires a recent Linux
kernel.

-- 
Best regards,
lilydjwg


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

* Re: DIY ZSH
  2015-03-12  8:31   ` Axel Beckert
@ 2015-03-12 18:46     ` ZyX
  2015-03-12 19:01       ` Axel Beckert
  0 siblings, 1 reply; 10+ messages in thread
From: ZyX @ 2015-03-12 18:46 UTC (permalink / raw)
  To: Axel Beckert, zsh-users

12.03.2015, 11:39, "Axel Beckert" <abe@deuxchevaux.org>:
> Hi,
>
> On Thu, Mar 12, 2015 at 12:15:34AM +0100, toki clover wrote:
>>  zzapper wrote:
>>>  I believe that you can extend zsh by writing your own modules
>>>  functions etc. But how many of you are actually doing this and
>>>  what sort of things are you doing?
>>  Take a look at oh-my-zhs[1] or prezto[2] on github.com
>
> At least omz is just a bunch of (z)shell code, no C code involved. And
> after a short search for prezto on github, it seems to be just yet
> another "zsh configuration framework". So I don't expect C code to be
> involved either.
>
> But as I understood zzapper, he actually meant writing stuff in C, at
> least "writing modules" implies that AFAIK.
>
> IIRC there was recently a thread on one of the zsh mailing lists about
> zpython, which embeds the python interpreter into zsh or similar:
> https://github.com/YaroslavLitvinov/zpython

How is YaroslavLitvinov repository related? I am doing development at https://bitbucket.org/ZyX_I/zpython. The repository you referenced here has absolutely nothing to do with zsh according to its description.

>
>                 Kind regards, Axel
> --
> /~\  Plain Text Ribbon Campaign                   | Axel Beckert
> \ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
>  X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
> / \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)


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

* Re: DIY ZSH
  2015-03-12 18:46     ` ZyX
@ 2015-03-12 19:01       ` Axel Beckert
  2015-03-12 21:03         ` ZyX
  0 siblings, 1 reply; 10+ messages in thread
From: Axel Beckert @ 2015-03-12 19:01 UTC (permalink / raw)
  To: zsh-users

Hi ZyX,

On Thu, Mar 12, 2015 at 09:46:30PM +0300, ZyX wrote:
> > IIRC there was recently a thread on one of the zsh mailing lists about
> > zpython, which embeds the python interpreter into zsh or similar:
> > https://github.com/YaroslavLitvinov/zpython
> 
> How is YaroslavLitvinov repository related? I am doing development
> at https://bitbucket.org/ZyX_I/zpython. The repository you
> referenced here has absolutely nothing to do with zsh according to
> its description.

Oh, sorry, my fault then. I just remembered the name, not the location
and that was my first hit when searching for zpython. Didn't expect
that there exist multiple projects with that name. (But then again,
there are only 26 possible names for ${one_character}python, so name
clashes should be expected.) So thanks for pointing out the correct
project location.

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)


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

* Re: DIY ZSH
  2015-03-12 19:01       ` Axel Beckert
@ 2015-03-12 21:03         ` ZyX
  0 siblings, 0 replies; 10+ messages in thread
From: ZyX @ 2015-03-12 21:03 UTC (permalink / raw)
  To: Axel Beckert, zsh-users

12.03.2015, 22:03, "Axel Beckert" <abe@deuxchevaux.org>:
> Hi ZyX,
>
> On Thu, Mar 12, 2015 at 09:46:30PM +0300, ZyX wrote:
>>>  IIRC there was recently a thread on one of the zsh mailing lists about
>>>  zpython, which embeds the python interpreter into zsh or similar:
>>>  https://github.com/YaroslavLitvinov/zpython
>>  How is YaroslavLitvinov repository related? I am doing development
>>  at https://bitbucket.org/ZyX_I/zpython. The repository you
>>  referenced here has absolutely nothing to do with zsh according to
>>  its description.
>
> Oh, sorry, my fault then. I just remembered the name, not the location
> and that was my first hit when searching for zpython. Didn't expect
> that there exist multiple projects with that name. (But then again,
> there are only 26 possible names for ${one_character}python, so name
> clashes should be expected.) So thanks for pointing out the correct
> project location.

If you happen to forget the location you may search for libzpython or `"zsh/zpython"`: these are names passed to zmodload.

zsh/zpython is a former name which requires "exact" search in Google (and no, `zsh zpython` does not work, not for me at least).

libzpython is a current name which brings you directly to the project page (after you tell Google you did not mistype libpython). It is current mostly because I don’t know how to tell CMake I don’t need `lib` prefix for the library built by it and don’t see much need in removing it.

In any case project name is zpython, libzpython is only zmodload argument.

>
>                 Kind regards, Axel
> --
> /~\  Plain Text Ribbon Campaign                   | Axel Beckert
> \ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
>  X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
> / \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)


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

* Re: DIY ZSH
  2015-03-12  9:07 ` lilydjwg
@ 2015-03-12 21:51   ` zzapper
  2015-03-13  3:59   ` Bart Schaefer
  1 sibling, 0 replies; 10+ messages in thread
From: zzapper @ 2015-03-12 21:51 UTC (permalink / raw)
  To: zsh-users


> I've written a simple zsh module to call
> 
> prctl(PR_SET_CHILD_SUBREAPER, reaping);
> 
> so that orphaned subprocesses won't get adopted by farther processes
> (e.g. init) when the shell is still there. It requires a recent Linux
> kernel.
> 

What was involved ?

-- 
zzapper
https://twitter.com/dailyzshtip

---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



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

* Re: DIY ZSH
  2015-03-12  9:07 ` lilydjwg
  2015-03-12 21:51   ` zzapper
@ 2015-03-13  3:59   ` Bart Schaefer
  2015-03-13  4:15     ` lilydjwg
  1 sibling, 1 reply; 10+ messages in thread
From: Bart Schaefer @ 2015-03-13  3:59 UTC (permalink / raw)
  To: zsh-users

On Mar 12,  5:07pm, lilydjwg wrote:
}
} I've written a simple zsh module to call
} 
} prctl(PR_SET_CHILD_SUBREAPER, reaping);
} 
} so that orphaned subprocesses won't get adopted by farther processes
} (e.g. init) when the shell is still there. It requires a recent Linux
} kernel.

This might be of interest to the people who are using zsh with the
Linux PID namespace feature.  Would you be interested in sharing?


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

* Re: DIY ZSH
  2015-03-13  3:59   ` Bart Schaefer
@ 2015-03-13  4:15     ` lilydjwg
  0 siblings, 0 replies; 10+ messages in thread
From: lilydjwg @ 2015-03-13  4:15 UTC (permalink / raw)
  To: zsh-users

On Thu, Mar 12, 2015 at 08:59:00PM -0700, Bart Schaefer wrote:
> On Mar 12,  5:07pm, lilydjwg wrote:
> }
> } I've written a simple zsh module to call
> } 
> } prctl(PR_SET_CHILD_SUBREAPER, reaping);
> } 
> } so that orphaned subprocesses won't get adopted by farther processes
> } (e.g. init) when the shell is still there. It requires a recent Linux
> } kernel.
> 
> This might be of interest to the people who are using zsh with the
> Linux PID namespace feature.  Would you be interested in sharing?

Here it is: https://gist.github.com/lilydjwg/0bfa6807b88e6d39a995

I just copied from the example module and made it build. It adds
a "subreap" builtin, with an optional "-u" option to unset the flag.

-- 
Best regards,
lilydjwg


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

end of thread, other threads:[~2015-03-13  4:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 21:22 DIY ZSH zzapper
2015-03-11 23:15 ` toki clover
2015-03-12  8:31   ` Axel Beckert
2015-03-12 18:46     ` ZyX
2015-03-12 19:01       ` Axel Beckert
2015-03-12 21:03         ` ZyX
2015-03-12  9:07 ` lilydjwg
2015-03-12 21:51   ` zzapper
2015-03-13  3:59   ` Bart Schaefer
2015-03-13  4:15     ` lilydjwg

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