From owner-svn-src-head@FreeBSD.ORG Mon Apr 5 14:15:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA77A106566C; Mon, 5 Apr 2010 14:15:51 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9568FC08; Mon, 5 Apr 2010 14:15:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o35EFpEM051984; Mon, 5 Apr 2010 14:15:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o35EFpiJ051981; Mon, 5 Apr 2010 14:15:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004051415.o35EFpiJ051981@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 5 Apr 2010 14:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206182 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2010 14:15:51 -0000 Author: jilles Date: Mon Apr 5 14:15:51 2010 New Revision: 206182 URL: http://svn.freebsd.org/changeset/base/206182 Log: sh: Automatically enable -o emacs in interactive shells with terminals. This makes sh a bit more friendly in single user mode, make buildenv, chroot and the like, and matches other shells. The -o emacs can be overridden on the command line or in the ENV file. Modified: head/bin/sh/options.c head/bin/sh/sh.1 Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Mon Apr 5 13:48:23 2010 (r206181) +++ head/bin/sh/options.c Mon Apr 5 14:15:51 2010 (r206182) @@ -93,8 +93,11 @@ procargs(int argc, char **argv) options(1); if (*argptr == NULL && minusc == NULL) sflag = 1; - if (iflag == 2 && sflag == 1 && isatty(0) && isatty(1)) + if (iflag != 0 && sflag == 1 && isatty(0) && isatty(1)) { iflag = 1; + if (Eflag == 2) + Eflag = 1; + } if (mflag == 2) mflag = iflag; for (i = 0; i < NOPTS; i++) Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Mon Apr 5 13:48:23 2010 (r206181) +++ head/bin/sh/sh.1 Mon Apr 5 14:15:51 2010 (r206182) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd April 4, 2010 +.Dd April 5, 2010 .Dt SH 1 .Os .Sh NAME @@ -210,7 +210,8 @@ Enable the built-in .Xr emacs 1 command line editor (disables the .Fl V -option if it has been set). +option if it has been set; +set automatically when interactive on terminals). .It Fl e Li errexit Exit immediately if any untested command fails in non-interactive mode. The exit status of a command is considered to be