Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: a way to get the value of the -c option
- X-seq: zsh-workers 37291
- From: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@xxxxxxxxx>
- To: Vincent Lefevre <vincent@xxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: a way to get the value of the -c option
- Date: Thu, 03 Dec 2015 17:36:18 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1449153379; bh=iCJeyvn+VObtKXfPcOtFgNTDfUQ6gD/VMm+gpJ6J00Q=; h=From:To:In-Reply-To:References:Subject:Date; b=vZiXUdKtmXoqxSUIZKzK+dKQ9gcxhB64Ws0zUsVgwbtS5qB+fAo3rF1rQPtuzstD5 ZAABaarBfuh/mweHyrjykGt1PE2TmM7p+ZnOZ2mNM3gAqAI5Qo+MamFPDe3wGZQXhF 27kjAgRdWSfcE9XX2spaPp4fOEFtFwxzZQ/R5b38=
- In-reply-to: <20151203115449.GA19846@zira.vinc17.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20151203115449.GA19846@zira.vinc17.org>
03.12.2015, 14:55, "Vincent Lefevre" <vincent@xxxxxxxxxx>:
> zsh should provide a way to get the value of the -c option. Under
> Linux, one can look at /proc/$$/cmdline, but I think that it would
> be better to get this information in an OS-independent way.
>
> This would be useful for .zshenv to know the context, for instance, as
> a user of OpenSSH, to know whether this is a shell used for ~/.ssh/rc
> (the -c value is '/bin/sh .ssh/rc' in this case). When $DISPLAY is
> set, I set up a part of my X11 environment from .zshenv, and this
> includes an execution of xdpyinfo, but before the ~/.ssh/rc script is
> executed, the xauth authorization hasn't been added yet, so that I get
> an annoying error message. So, the idea is to disable this set up for
> this -c value.
This is good idea: I personally have a few `exec` calls in my zshrc (basically they do two things: launch shell in dtach if it is not already in tmux/dtach/screen and use `hilite` program if it was not already used), but by doing this I loose the possibility to use `zsh -ic`. Presence of the variable which contains `-c` argument will fix this problem.
>
> --
> Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author