From owner-freebsd-questions@freebsd.org Tue Jul 25 19:28:24 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 906B0D7C275 for ; Tue, 25 Jul 2017 19:28:24 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 563763EE0 for ; Tue, 25 Jul 2017 19:28:24 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: by mail-io0-x244.google.com with SMTP id j32so4271999iod.3 for ; Tue, 25 Jul 2017 12:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=hkPNAelRWqPZrDG0dzNnptLNOTuCe628UMD6Ihi/EQc=; b=ScKkvYZtTOS7opBIyPHHirGETR04ulhF+ypvXsS8ozanCjnUdABKG+t2wl4ebKMA6/ HC3b1SEWkQ9ZkLzLHDPGEBKeVn+g/0Z2De32kcJZ7HmHMKvUu5blCMYks3Wmenpm/oep L62RgmXcYjFkvr9FvIuC+EgyvVjn8roeXDN4LJKUnspkQ+EfknztEK3HfFhU5d0EfUwC G/jPfke/RpNqVJ7G29g02Btbp3UcarlH5FKlT5kJl7/Cmlvn+DKTjNl3LXcBU0DDUrxA pqEXnbLOmo7P1s3PKzqPJlZGpB8B/EkMuO7CglgGjwpM+GUtn6vi5yLnG1Q+t5vV7961 eoHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=hkPNAelRWqPZrDG0dzNnptLNOTuCe628UMD6Ihi/EQc=; b=ZcjskM6orx+UvWXtjvPrz58VA3eJwhsGhiy3HSnSSs9tJBxfHlsH2kISCiDgNPonqS gbasvvX2ogfKrn381Uf4dshQpHxsRY8OY/2zECMysjXJII9Rx3DuJnkaHjzs3/FQ6vut dJiRyfSsVyXvsY95acmo/G7bsNpih21IGzFIz83ow5MZvLrEf5fZgPMrDFHZ879xt0Cp OyWqjlh6pe/yRLl0JgB2Okqm9kGxiaBVbKj8GfqyqIXH6ltH1eUbWi+Aa2ICyUqUPwWm fobqqKNLMFUniOg64S4u5HUdS4+Dib7pYtHQGzahzqOgobpNsF+UbSgTrAWM8tWSJiyw rVCQ== X-Gm-Message-State: AIVw110yqPeK2EUmMSTeFy1PJwqnVAvQPC4WzE3XWjJQ3yntJngy7+OY /RneilFok8oFte+G X-Received: by 10.107.170.38 with SMTP id t38mr19335760ioe.321.1501010903527; Tue, 25 Jul 2017 12:28:23 -0700 (PDT) Received: from localhost.localdomain (50-243-4-3-static.hfc.comcastbusiness.net. [50.243.4.3]) by smtp.googlemail.com with ESMTPSA id b66sm3689197ioj.66.2017.07.25.12.28.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jul 2017 12:28:23 -0700 (PDT) Subject: Re: FreeBSD-11, Mate, Terminal, Gvim To: freebsd-questions@freebsd.org References: <20170725210647.6f4c8fcd.freebsd@edvax.de> From: JD Message-ID: <59779BC9.8030809@gmail.com> Date: Tue, 25 Jul 2017 13:28:09 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <20170725210647.6f4c8fcd.freebsd@edvax.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2017 19:28:24 -0000 On 07/25/2017 01:06 PM, Polytropon wrote: > On Tue, 25 Jul 2017 10:39:29 -0400, James B. Byrne via freebsd-questions wrote: >> When setting up new hosts I usually open an especially coloured >> terminal instance and use 'su -l' to become root. I also typically >> edit using gvim. However, this combination does not work for me on >> FreeBSD with Mate as it did for me under CentOD-6 and Gnome2. When >> inside a terminal window as root instead of opening an Xwindow editor >> when running gvim I get a 'E233: cannot open display' error. > This is to be expected. > > With "su -l", a full login is simulated, so all environmental > variables will be reset - but $DISPLAY is needed for X. There > are basically two solutions: > > 1. Set $DISPLAY accordingly, for example to :0.0. Refer to the > documentation of your shell on how to do it, for example in > C shell "setenv DISPLAY :0.0", in sh/bash "export DISPLAY=:0.0". > > 2. Use "su -m" instead, which will preserve the environment of > your user, and $DISPLAY will be kept set. > > See "man su" for details. There is another way which some people might criticize as unsafe, but here it is: as the normal user on the X display, type in the terminal xhost +root@localhost sometimes you have to completely qualify "localhost" with how the name appears in /etc/hosts: such as: localhost.localdomain After that, su to root and as root, issue the command setenv DISPLAY "0:0" if using bash or sh , then export DISPLAY="0:0" now, as root, any graphical tool you invoke will run.