From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.devel Subject: Re: Wrong default-directory in shell buffer Date: Tue, 17 May 2022 21:14:23 +0200 Message-ID: <87lev09dkg.fsf@gmail.com> References: <874k1vzyom.fsf@posteo.net> <87lev2j3g0.fsf_-_@gmail.com> <87h75pic7h.fsf@gmail.com> <875ym5i8cz.fsf@gmail.com> <87wnekfpjx.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14381"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 17 21:17:18 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nr2h3-0003c6-Ph for ged-emacs-devel@m.gmane-mx.org; Tue, 17 May 2022 21:17:17 +0200 Original-Received: from localhost ([::1]:49766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nr2h2-00066T-KS for ged-emacs-devel@m.gmane-mx.org; Tue, 17 May 2022 15:17:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nr2eL-0003PX-9q for emacs-devel@gnu.org; Tue, 17 May 2022 15:14:29 -0400 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:37448) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nr2eJ-0003Sh-MG for emacs-devel@gnu.org; Tue, 17 May 2022 15:14:28 -0400 Original-Received: by mail-wr1-x42f.google.com with SMTP id t6so26015585wra.4 for ; Tue, 17 May 2022 12:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=yxvXeQ1Gs7+K8qTh5iz5msTJ3gMSBWhz82MTekRsXVA=; b=iP/FySJVqwx2qcMmKGSTxL3Zw3aAMXrQOvW5qJ1YlXe8961vpyHrV7MmqIWHDPW6of gXL56eckN7lqWOPHBdnlpG/jq+sbHuG/CSo1LDp8xwn805Hkc7bpZjYWPw/eVZgta9V8 bXka8elPIogE9jhF7Hr92FbklHTUNVGLY1o5D7O+JzYo56WbalRcIp+PKFaGCuaK82L3 ecxPSKWkQ8/1aItbH3Sf6vy+P9jVv4m9V6mg4HwkUUi+VGV1Bg1stnoI0mA7o9MpEple QcdHAsuoj5MOiyDh4m4/ZZihiK2A2i3IVyV73PM7DYPnOlUniNjujn0E99nqhd+qwBQT 67dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=yxvXeQ1Gs7+K8qTh5iz5msTJ3gMSBWhz82MTekRsXVA=; b=O35K31hGHQagM6IDVQzlEAuy1gyWX4CaBuVgXGb1emBLtErGe4Z0tLJVWU/v0zD/B+ L0oAfz1euoIQp71hpExyR2rAQsaMrgaZCyD6h8XfOKblE8WSMu0/I6+kaqfgXJZvF8wV KPGby1Ap7SCTq5d3urZAyLc3WhX7zSmb9Aj49+IrXYqU/y+tU46xPhRF0Nix1upVXMsX YMicG1CPNVjJ3Cuide9aYk6L6Nvltp9cinzWAREJDHNrKEuHHDzCQftIbMWl1GZtX4km ZHGcjIxTW2BvSOBPD3uzwCfaKYVZRoGlcV6Xp2usENemeF+veomolKh+3iQAGNeBsN8C PRFQ== X-Gm-Message-State: AOAM533aYmmDjQnt9+kcbmZI4bKPImOf92+0+bIMzah9BvhbB5ij71jF z4lkwQtaF/TSaf4JYb8iNrUQVh+grzc= X-Google-Smtp-Source: ABdhPJxy+/pMDseML7ffz36N/+PzrplfO2olbY4kZBn8yItKxxZT5Zed5QtOLrL2Esx+OOEp5dgrAg== X-Received: by 2002:a05:6000:18ac:b0:20c:ba84:1260 with SMTP id b12-20020a05600018ac00b0020cba841260mr20432191wri.379.1652814865547; Tue, 17 May 2022 12:14:25 -0700 (PDT) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id n34-20020a05600c3ba200b003945781b725sm2908434wms.37.2022.05.17.12.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 12:14:25 -0700 (PDT) In-Reply-To: <87wnekfpjx.fsf@gmail.com> (Visuwesh's message of "Tue, 17 May 2022 15:28:58 +0530") Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=orontee@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289871 Archived-At: Visuwesh writes: > (...) I have come to the conclusion that the most reliable way to > track directories is to stick the directory in the prompt and parse > the prompt in Emacs side, or if you're on Emacs 28, you can use the > OSC7 escape sequence to track the directory. I do the latter now, and > so far no problems. Do you have any implementation of the OSC7 trick to share? On the other hand I must confess I don't understand why we don't rely on the current directory of the buffer process (from the Unix point of view): matthias@carbon:~/Projets/argos$ mkdir builddir && cd builddir matthias@carbon:~/Projets/argos/builddir$ readlink -e /proc/593787/cwd/ /home/matthias/Projets/argos/builddir I've read in efaq.info, node: Shell mode loses the current directory, that there's an intrinsic limitation of Unix but I don't know where this limitation comes from and if it applies to many Unices... -- Matthias