Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 25E36431FD0 for ; Fri, 11 Nov 2011 03:30:00 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KCszDFmBLBGt for ; Fri, 11 Nov 2011 03:29:59 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id DBD0C431FB6 for ; Fri, 11 Nov 2011 03:29:58 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pABBTmmw000575; Fri, 11 Nov 2011 13:29:49 +0200 From: Tomi Ollila To: Dmitry Kurochkin , Tomi Ollila , Notmuch Mail Subject: Re: [PATCH] test: use dtach(1) instead of screen(1) in emacs tests. In-Reply-To: <877h373vbs.fsf@gmail.com> References: <1320963737-1666-1-git-send-email-jrollins@finestructure.net> <877h373vbs.fsf@gmail.com> User-Agent: Notmuch/0.9+23~g556c5fa (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 11:30:00 -0000 On Fri, 11 Nov 2011 12:41:11 +0400, Dmitry Kurochkin wrote: > Hi Tomi. > > On Thu, 10 Nov 2011 14:22:17 -0800, Jameson Graef Rollins wrote: > > From: Tomi Ollila > > > > dtach is lighter than screen and is not setuid/setgid program so > > TMPDIR does not get reset by dynamic loader when executed. > > > > Signed-off-by: Jameson Graef Rollins > > --- > > This tweaks the original patch slightly by removing the no-longer needed > > screenrc variables. > > > > test/test-lib.sh | 5 ++--- > > 1 files changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/test/test-lib.sh b/test/test-lib.sh > > index c81c709..c0fe037 100755 > > --- a/test/test-lib.sh > > +++ b/test/test-lib.sh > > @@ -50,8 +50,6 @@ TZ=UTC > > TERM=dumb > > export LANG LC_ALL PAGER TERM TZ > > GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u} > > -export SCREENRC=/dev/null > > -export SYSSCREENRC=/dev/null > > > > # Protect ourselves from common misconfiguration to export > > # CDPATH into the environment > > @@ -844,7 +842,8 @@ test_emacs () { > > if [ -z "$EMACS_SERVER" ]; then > > EMACS_SERVER="notmuch-test-suite-$$" > > # start a detached screen session with an emacs server > > - screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \ > > + TERM=xterm dtach -n "$TMP_DIRECTORY/dtach-emacs-socket-$$" \ > > Can you please give a more detailed explanation (and a comment) to > justify this workaround: > > * Is it actually needed for dtach or emacs? If it is the latter, then > it should be "dtach ... env TERM=xterm emacs ...", right? dtach doesn't care about TERM, it is emacs which does (as you noticed below). But it is bood that the TERM is same in dtach's environment. doing VAR=val command args instead of env VAR=val saves one execve(2) as the shell does the environment setting (after fork before execve) > > * Why should we care about systems that use terminals without > corresponding terminfo installed? That's the issue I thought, armdragon on IRC thought etc. The 'xterm' is part of ncurses-base on Debian, at least (thanks armdragon for this info) and is it pretty much as base to every terminal emulator there is (I just launched gnome-terminal for testing, TERM was set to xterm -- it may have been initially in environment but if gnome-terminal changed it before launching shell, my shell config will not change it) > * Why is it safe to use xterm? Is there any standard that requires > xterm info to be present on the system? xterm is not needed, it is just to tell emacs it can use it's display control sequences. more common alternative would have been vt100, just that if one ever wants to attach to that emacs session you he gets better experience (such as colors), using any terminal emulator, like rxvt. > I have tried running dtach with emacs in rxvt-unicode and it worked fine > without overriding TERM. you had originally suitable TERM to be passed to emacs. > > I have also tried running dtach with invalid TERM: > > $ TERM=non-existing-term dtach -n s /bin/sh > zsh: can't find terminal definition for non-existing-term > > No segfault, shell is started fine. Yes, dtach could not care less... > > But emacs does not work without a valid terminfo: > > $ TERM=non-existing-term emacs -nw > emacs: Terminal type non-existing-term is not defined. > If that is not the actual type of terminal you have, > use the Bourne shell command `TERM=... export TERM' (C-shell: > `setenv TERM ...') to specify the correct type. It may be necessary > to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well. Yes, I got SIGSEGV -- strace -o oprfx -ff command args is your friend :D > Regards, > Dmitry Thanks for your analysis. Tomi > > > + "$TMP_DIRECTORY/run_emacs" \ > > --no-window-system \ > > --eval "(setq server-name \"$EMACS_SERVER\")" \ > > --eval '(server-start)' \ > > -- > > 1.7.7.1 > > > > _______________________________________________ > > notmuch mailing list > > notmuch@notmuchmail.org > > http://notmuchmail.org/mailman/listinfo/notmuch > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch >