[haiku-commits] Re: r38133 - haiku/trunk/src/apps/terminal

  • From: François Revol <revol@xxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 16 Aug 2010 13:01:26 +0200

Le 16 août 2010 à 12:50, Axel Dörfler a écrit :

> François Revol <revol@xxxxxxx> wrote:
>> Le 16 août 2010 à 11:53, Axel Dörfler a écrit :
>>> If bash is invoked as "sh", it should already do that in order to
>>> mimic
>>> POSIX requirements - and AFAICT that's what we do.
>> No.
>> Running /bin/sh alone doesn't make it a login shell.
> 
> Indeed, I misread that paragraph.
> 
>> The correct way to start a shell from a terminal should be with
>> argv[0] = "-theshell".
>> This indicates it's a login shell (and not a subshell).
>> 
>> For ex here on OSX ps x gives:
>> 1071 s007  SN+    0:00.68 -bash
> 
> FWIW this is not seem to happen on Ubuntu, at least, and while it's
> documented behaviour for bash, I see no mention of this feature in the
> POSIX shell description.

On debian at least there doesn't seem to be traces of login processes, but 
maybe login just exec()s the shell.

At least the - thing is also used on Linux:

21706 ?        S      0:00 sshd: revol@pts/0
21707 pts/0    Ss     0:00 -bash

compared to the shell spawned by screen (I'm wondering actually why it doesn't 
make it a login shell though, since it uses a different pty):

071 ?        Ss     0:39 SCREEN -S irc
13072 pts/1    Ss     0:00 /bin/bash

François.

Other related posts: