delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/10/13/11:29:23

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4CB5D042.4060809@redhat.com>
Date: Wed, 13 Oct 2010 09:29:06 -0600
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: screen 4.0.3-5 does not respect $SHELL
References: <BAY157-w64AE820D2F752B0BC9AE8E8D540 AT phx DOT gbl> <bt49b6pipkvps8m1thfoptvk4gbu6qr9qq AT 4ax DOT com> <4CB5C2D1 DOT 6010702 AT dronecode DOT org DOT uk> <idjbb61m8t17jievd00sg9i959nogvlood AT 4ax DOT com>
In-Reply-To: <idjbb61m8t17jievd00sg9i959nogvlood@4ax.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 10/13/2010 09:22 AM, Andrew Schulman wrote:
>> On 12/10/2010 18:00, Andrew Schulman wrote:
>>>> Initially SHELL=/bin/bash when using a link in start menu.From initial bash prompt, i start screen, fresh session. There all kinds of bash misbehavior occur, including ~/.bashrc having no effect. Apparent reason for that is that $SHELL becomes /bin/sh instead of /bin/bash within screen.
>>>> A workaround is to start screen asscreen -s /bin/bashor have shell specified in .screenrc. Then bash works as expected. That screen does not respect $SHELL seems to be a bug though.
>>>> Thanks to jturney from #cygwin for helping me pinpoint the problem.
>>>> -anna 		 	   		
>>
>> The problem seems to be caused by the fact that bash sets SHELL, but does not
>> export it by default, so screen doesn't inherit it and sets SHELL=/bin/sh.
>
> OK, I see.  And I do export SHELL in my bash startup scripts, so I don't have
> this problem.
>
> I can see two possible solutions:
>
> (1) Tell users to export SHELL=/bin/bash if that's what they want processes
> spawned by the shell to use.
>
> (2) Add 'shell /bin/bash' into /etc/screenrc, on the theory that this should be
> the default since bash is the default shell for Cygwin.  Users who wanted to use
> a different shell could override it in their .screenrc files.

(3) teach upstream screen that it should use getpwent() and honor the 
pw_shell entry for the user, rather than relying on $SHELL

-- 
Eric Blake   eblake AT redhat DOT com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019