From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7a24065a for ; Thu, 2 Jan 2020 02:52:30 +0000 (UTC) Received: (qmail 17817 invoked by alias); 2 Jan 2020 02:52:24 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24590 Received: (qmail 25532 invoked by uid 1010); 2 Jan 2020 02:52:24 -0000 X-Qmail-Scanner-Diagnostics: from mout.gmx.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25677. spamassassin: 3.4.2. Clear:RC:0(212.227.15.15):SA:0(-1.9/5.0):. Processed in 3.41434 secs); 02 Jan 2020 02:52:24 -0000 X-Envelope-From: dominik.vogt@gmx.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at gmx.net designates 212.227.15.15 as permitted sender) X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Date: Thu, 2 Jan 2020 03:51:41 +0100 From: Dominik Vogt To: Zsh Users Subject: Re: DISPLAY problem with zsh + fvwm + firejail Message-ID: <20200102025141.pn37a5fzsrhsyma2@gmx.de> Reply-To: dominik.vogt@gmx.de Mail-Followup-To: Zsh Users References: <20200101205833.puf6pb3cylcd47qt@gmx.de> <3C10D9A3-2DC6-4279-A242-77C6E9D9474B@dana.is> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C10D9A3-2DC6-4279-A242-77C6E9D9474B@dana.is> User-Agent: NeoMutt/20170113 (1.7.2) X-Provags-ID: V03:K1:yBzbQoGQHf+2iSSFnQiQATFuVmNALAxJuT2ljtYweuE9igCJKa7 3uifH87NtFmpdyirzhrDr/PfZp1lDlNJeKcpqqmLun7f2x+lYQvN4tlryl0Fv36T80U+kI7 3WBzNAjvMZqFC3T08MpByrbtmR5XMdC/CQ0JM+lekNnZ9Q/X6gVO5ToWwTKPnpGnz2LZsye ap/RvJdc4oV997vEJY1Ow== X-UI-Out-Filterresults: notjunk:1;V03:K0:vzIqVJWhgfw=:JMAqjqWnJiLIfveEibmtQR pvsD0+fFE287SSY+rOGcwp/15BFz9deH85gK9PKCZyHnoHShwp6dFlaPb6k4w4IOg6gS8sSwN 6sDqqkx1lZPmqhyKUWmcRHTubmtCFD7KAwaaBWCVT08V2gEwc3qEAQ4KtEjsfXols/qgcquFY hFoldLIBEfQrR4oah2IjAmX2wQkpBZa/YWpwd0Tw8EYIzQmOYN2SfOPGe8VMKlw81vTNU9x9j 3xOBlT4+rxYvWLDLo1oeylsGlfze3KfRUD9c3Fs2N9tc7BykiqFPkP9zkC8AB2vUI6GTt3ccX x/O6Ht2pNnqU5h6CD0H0Y/7DU457IwjPRiZiY317QipjS9pTHyzywRlDTefP7m3XPvwn3jP8A CRflr7QnG+iTeS6geAO3ng6VXIEwYk0UXaZe0gTvVpLb7JJrgvI82cHNPiHYE9PSCoSI11qXK 88iLpZj4x8jC6LnBAhj1w7nncVliTgmwov8pZvlJrlv7Go5bXhCUQNI9SUGh2gigZIo4anV9H 3BRqM4x6c2D1iO4EXG7ROfDpiYZPqTVsmJdCigSp5taqoM3omMk0LMJp6dTVnmhKnU+wTEYon pdkNMyrVLuEYN/3YgdBywsb/UM7ua1jZ4RBMjOvNXvFtxeNV6jADxHa4gnnzzRt1lM/rB5gWW qzyOG+mBcWbt+m9OlK4bwu2QimetEfJ+zh+3KnmPyrnRi6kJDkpMTI0qCJeb51EFOqzmbd3DL hwkDy0TJVZNfQVxvjhLhYW2d2uahHNep3BtWRNLX2w1vDtyHgNEuJMARfuMMAjqCsvU530DXj C7r27+HYONHpdzIuCpZgLrgH5olmyDsK7oiTa7WCKZt8pJ6t38AnDTC89Cm0GLh4b06HYk7kJ u7Hvef5dEPm9CfrvgsBSQYQtdD/WPNKt0BF5jF4sjMn5ArDWJuYMn/Hj/7BTpOp3GBOh2yyWv rPUobD56t5F7Rb1BZsxDBg9VySsCCjXx7df7s/pfgbGTSuDozJx0i+iA1Eol9HrjJmtsHnQbe Xo7dMTkK+cr2BC0HUwvDWCwt9I5hHfbHo6YiV7ga9ZUW9BC8Rcuhpdpff+JHmi78Xue/Gs99f e0Qt3zm1fUllm3Sr83yMkDswjc1DdB2yi37PkvT4tgWK+vjccYNrwVYc5xiZVHS85h3qUgrK3 hAgm31MZw0qMtk8BSoV/hxXRBDt6+kdc2duzzUqz3u/7grAG17PKyeHotFC+J5TX5BUY7e/Qq Ql8Ud+EU1AWJxv7uaRBLkKeSAj/VqqzJrnENS1p1nR0783mwN1TAoPuuQPb8= Content-Transfer-Encoding: quoted-printable On Wed, Jan 01, 2020 at 08:16:34PM -0600, dana wrote: > On 1 Jan 2020, at 14:58, Dominik Vogt wrote: > > I can't firgure out what's going on. For some reason, DISPLAY is > > set to an empty string between the final execvp() call in firejail > > and the place that uses the value, and the shell may or may not be > > involved in this problem. Note that the same occurs if any shell > > is set explicitly: > > I have absolutely no experience with fvwm or firejail, but: > > In the first place, i don't understand what your output means when it sa= ys > that DISPLAY=3D:0 is passed as an argument to execvp(). execvp() doesn't= take > environment variables as arguments. Not as argument, but it preserves the contents of the "environ" global variable so that the new executable uses the same variables. Is it using something in between, like env > or sh, to run it? Or is it just worded imprecisely? > Assuming the latter, could it be that you have some kind of shared file,= like > /etc/environment, that shells on your system are configured to run on > start-up? Sure. > And maybe that's clearing DISPLAY based on other environment > variables or whatever? No, the shell does not clear it. The contents of DISPLAY are overwritten between the final execvp() of firejail (i.e. they're still there right before the call). But the executed binary gets an empty value. > That seems like a silly thing to do, but if you export > a variable and then it's unset/changed when you check it from within the > shell, that's the first thing that comes to mind. (Excepting a few speci= al > variables that the shell uses for itself, obv.) DISPLAY is of course exported, otherwise *nothing* that ist started from the window manager would work. > Does it show the correct value if you just run env instead of zsh? No, it's also empty. Note that firejail automatically runs the command from a shell (zsh in this case) if its not explicitly told otherwise with $ firejail --shell=3Dnone foo Without hte shell, the value is fine. > If not, i think that would mean it's not actually exporting it > the way it's suggesting it is. If so, something running in the > shell unsetting it seems more likely. But "exporting" variables is a concept of the shell, right? So an execvp() in a random program knows nothing about "exporting" variables - the called executable just inherits the whole environment(?). > Anyay, you can run zsh with -x to see what it might be doing before the = set > command. You might also try it with -f (to disable sourcing start-up fil= es) Okay, found it. I've some decades old code in /etc/zsh/zshenv to unset the DISPLAY when running on a console. Something about X being slow on AIX ages ago, can't really remember. if [ "$TERM" =3D linux ] ; then export DISPLAY=3D Which kicks in here because the window manager was started from the console with the value TERM=3Dlinux. :-/ Thanks for the hints. Ciao Dominik ^_^ ^_^ =2D- Dominik Vogt