From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28421 invoked by alias); 3 Dec 2015 14:42:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37291 Received: (qmail 9533 invoked from network); 3 Dec 2015 14:42:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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= From: "Nikolay Aleksandrovich Pavlov (ZyX)" To: Vincent Lefevre , "zsh-workers@zsh.org" In-Reply-To: <20151203115449.GA19846@zira.vinc17.org> References: <20151203115449.GA19846@zira.vinc17.org> Subject: Re: a way to get the value of the -c option MIME-Version: 1.0 Message-Id: <1135371449153378@web11g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 03 Dec 2015 17:36:18 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 03.12.2015, 14:55, "Vincent Lefevre" : > 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 - Web: > 100% accessible validated (X)HTML - Blog: > Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)