From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#48579: 28.0.50; Spawning an emacs process using call-process results in inconsistent, behavior between GNU/Linux and macOS Date: Sat, 22 May 2021 14:01:06 +0100 Message-ID: References: <2d81bff4-21fc-ce96-f1f1-f0bbf60b233e@daniel-mendler.de> <9002b376-2ef7-db7d-9d7a-092cda82efe1@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36016"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48579@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 22 15:02:20 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lkRGl-0009C8-PX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 15:02:19 +0200 Original-Received: from localhost ([::1]:37774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkRGk-0004Nh-Rm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 09:02:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkRGU-0004NW-Ah for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 09:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkRGT-0001AS-W9 for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 09:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lkRGT-0008HA-St for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 09:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 May 2021 13:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48579 X-GNU-PR-Package: emacs Original-Received: via spool by 48579-submit@debbugs.gnu.org id=B48579.162168847931763 (code B ref 48579); Sat, 22 May 2021 13:02:01 +0000 Original-Received: (at 48579) by debbugs.gnu.org; 22 May 2021 13:01:19 +0000 Original-Received: from localhost ([127.0.0.1]:38517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkRFm-0008GF-Ob for submit@debbugs.gnu.org; Sat, 22 May 2021 09:01:18 -0400 Original-Received: from outbound.soverin.net ([116.202.65.218]:50885) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkRFj-0008Fz-Ht for 48579@debbugs.gnu.org; Sat, 22 May 2021 09:01:17 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id C24366008B; Sat, 22 May 2021 13:01:09 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1621688469; bh=xjJvHRm7zsMOMIIdw28011wmT6783Bc/hUw6zLN9ruw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kPV/+4OAQ9PmLZSob1qfb2niIU4a8vQueFF9r2FfVyQ5D1eCo2rDxDO4uSrWfcm4U Ud75Yo/+EyR0ifnEDLYPT4FuSDqJ7o4DMBzOxl2HWn18d+v+qMzTF00HqzqJs89M1r Tp/Jn08d7Yoh6TOX1YUHHl7vPOznQoziJsLbyby3Hhx4/K5U9t9vtMJ4hiaoI41KHC Nbgg2zxqLpqPzh9yrQnk6dZESiFKDn3J7wF0+RLz2F99rxxSDBVvDrSiku2gqNldHa heskoVmFdRUjMsy/Iqt7PGLjd4I8EdNENXwWAGDgnxVW60gyh0+dnx4Y+GjRK+FoLa 5dqmfJ1GsjxlA== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1lkRFa-0007p7-Hh; Sat, 22 May 2021 14:01:06 +0100 Mail-Followup-To: Alan Third , Daniel Mendler , Eli Zaretskii , 48579@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <9002b376-2ef7-db7d-9d7a-092cda82efe1@daniel-mendler.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207048 Archived-At: On Sat, May 22, 2021 at 02:14:53PM +0200, Daniel Mendler wrote: > On 5/22/21 2:06 PM, Alan Third wrote: > > On Sat, May 22, 2021 at 01:44:27PM +0200, Daniel Mendler wrote: > >> Both GNU/Linux and macOS are Unixes, it is expected that Emacs behaves > >> in the same way on both platforms with regards to handling the current > >> directory. When Emacs is started via the command line or via forking > >> from another process, Emacs should inherit the default directory from > >> the parent process. If Emacs is started via some special finder or > >> desktop application, the default directory of that finder application is > >> taken. This is all predictable and expected. > > > > If you want Emacs on macOS to work like a Unix command line app, then > > build it as a Unix command line app, not a macOS GUI app. > > I am not talking about GUI vs terminal, You kind of are. The only reason this would happen is that the emacs executable you're executing is within the GUI app bundle or at least has been built to run as such. > the problem here is if Emacs is started from a script. Would it be > possible to adjust the directory changing behavior, for example if > Emacs is started with the arguments `--daemon`, `--batch` or > `--script`? Is there another way to detect if the finder launched > Emacs, such that only in that case the directory changing to the > home directory takes place? You can run with "-t", "-nw", "--chdir", "--batch" or "--script" to disable this behaviour. -- Alan Third