From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Colton Goates Newsgroups: gmane.emacs.bugs Subject: bug#74524: 29.4; dirtrack-mode Date: Mon, 25 Nov 2024 19:32:14 -0700 Message-ID: References: <86iksbij3m.fsf@gnu.org> <867c8ri1o8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000058ba870627c7aa14" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33972"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 74524@debbugs.gnu.org To: Ship Mints Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 26 09:16:21 2024 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 1tFqk8-0008iu-Nc for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Nov 2024 09:16:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFqjs-0006To-QW; Tue, 26 Nov 2024 03:16:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFqjr-0006TQ-Cu for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2024 03:16:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFqjr-0005wU-2E for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2024 03:16:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=josWvJBaM8w5Bpqq0Swc/y1BV0v9sEnXJnpNQ6lx3ig=; b=MQNWV5d04ymd4ZD6KzpuYI4EydRk0lPhNxFMU6aDdyBTvKrj4CMSGcdavBi1cYjW1/201SLoh8e37pKqBrvjvB28JRHvmpqqF/1B3XBFtCK34B6wNbnXzzptQiHLEGWG6WguzfPOKdBVmLJcGcextTj0ABw44fHY8hhy4fpGksI0HMSmkst1/rzXRijBidEjVham/aXJMgTwjXpnQ/B9JIPLKiTCbHaowmzPHIT3Dw55i3hBwU8k47sXmcWZHAkxigyjILkLhIXvX/0OvNiEoHymO4l6v8aZi0Lobel62AkIg59lA8wOd7NEc9YyWQKbfMxW4lxf5zyafhsjTibuGg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFqjq-0004Yu-SX for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2024 03:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Colton Goates Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Nov 2024 08:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74524 X-GNU-PR-Package: emacs Original-Received: via spool by 74524-submit@debbugs.gnu.org id=B74524.173260890517083 (code B ref 74524); Tue, 26 Nov 2024 08:16:02 +0000 Original-Received: (at 74524) by debbugs.gnu.org; 26 Nov 2024 08:15:05 +0000 Original-Received: from localhost ([127.0.0.1]:45572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFqit-0004RI-S7 for submit@debbugs.gnu.org; Tue, 26 Nov 2024 03:15:05 -0500 Original-Received: from mail-yb1-f175.google.com ([209.85.219.175]:57571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFlOl-0004Wx-OL for 74524@debbugs.gnu.org; Mon, 25 Nov 2024 21:33:56 -0500 Original-Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-e38938a55e7so4672711276.2 for <74524@debbugs.gnu.org>; Mon, 25 Nov 2024 18:33:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732588370; x=1733193170; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=josWvJBaM8w5Bpqq0Swc/y1BV0v9sEnXJnpNQ6lx3ig=; b=fnZEgO2k9skKum1srEn6a2Uj6ucDm5dk9kNdyLyprGuAjpisO4q/wgxfqqYHem6n/W yMliEJijV5lOxlVgc0ddkfUgcw8Z4DXFShhQP6ul4z2Uu9nB4+iXxa8NqRZ+9GOskGxk U4M9U1deyhUrhYK846qt3qxTcA7KiXYfuCm/ybprvWz/T22NWHcF531czyDJPhXPfQhf RoCdWXHji8lGoBOVPdRwV5/GCS7v+1dU03mM7E0jaAHGF/uHj/L/y2uvrWUXzdaP4aTh 91JFoNot7VZY9CW3R8LZNTcYHFerFwBsVVD9UPokCxMQUN8NLpKj9JSLSZhmaxueuxFu RwzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732588370; x=1733193170; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=josWvJBaM8w5Bpqq0Swc/y1BV0v9sEnXJnpNQ6lx3ig=; b=agp0CHnJIqnYuuVJvggNvqKUb/Nyv0LfwmjUmmSopEoV2zPi5RG60Rnnj0D0gf7LMV fWCcRADyIbeHXRAEN8UytR4JzOT1zMRVbOKe4t3WkeSsVA4Oe66JZ0wLB6P7/nUwlQwN wjun0mAsVl6G39U3hqopVncPstSCYetBVHYX+tfv4WIdLi6veWAU+Ne9Om+eviK2ejtC 3QsIuLK2/evXOTkY+k0Kk7reQq/S13uns7veI/K+oAqUnHCT243CPJUbQ0Iu5p6OhtiE XMl3yCsDx6+N2E/aq29xd8wHYdvF1zlcT6l+7mWYS1Dc08BzTEePoLdMouBlu7chsPY1 dAYA== X-Forwarded-Encrypted: i=1; AJvYcCVCertHYxxYhc7AzC+Xkkr0tAofmNRZ2FdrKRBuXk9b4En3iaa6W+J6uZLRxzRFrorcefFUqg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxEEsKqMtMZr4AGG75hXHzUGnVmOUNThJ6tZvG+4sgmah4sZ3gl WR/coVARtA8zd1w50spMN8TKG3KR3sOcqDOW0C9t1MJmxpcu6GXq1E0fHPiSgb9kh5Gois4elUM fa0u0gKcy5UvyidhoC1wm5PXnepg= X-Gm-Gg: ASbGncuYDZSOEUSCTtBUlG9MckjODz1nJZMSqKYk7lCaZ6pPMDPQ8dD/wyiqDLQsW+O QR0ntAH7uU337AA4MOWgJfBkTTtMsUtN6q76qRieyDUOn/j9d3o0Ods4vgWHcG2L7QA== X-Google-Smtp-Source: AGHT+IEAmKIPl+3kZZsONCLKc8N+CqAwyn7H+FtKcgaTp03j2P0mlo5kdHKsAS9e1kyJ2OrBmZnPvmNwvjd+kOklh70= X-Received: by 2002:a05:6902:701:b0:e38:901b:602d with SMTP id 3f1490d57ef6-e38f8af7c41mr12896547276.9.1732588370176; Mon, 25 Nov 2024 18:32:50 -0800 (PST) In-Reply-To: X-Mailman-Approved-At: Tue, 26 Nov 2024 03:15:01 -0500 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295977 Archived-At: --00000000000058ba870627c7aa14 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I did what Ship Mints suggested, and it didn't work on my macbook i.e. no directory tracking is happening. I checked directory tracking via the `default-directory` variable and it did not change in response to cd commands. I made sure to restart emacs to ensure that everything got loaded. I have Emacs 29.4 (installed with brew) and I'm running macOS Sequoia 15.1.1. See below for my configuration: Here is my .bashrc: *function myprompt () { printf "\e]7;file://%s%s\e\\" "$HOSTNAME" "$PWD"}export PROMPT_COMMAND=3Dmyprompt* And I added this to my init.el *(add-hook 'comint-output-filter-functions #'comint-osc-process-output)* Does anyone have debugging tips? On Mon, Nov 25, 2024 at 12:08=E2=80=AFPM Ship Mints w= rote: > If you're using a shell that can support the following ansi osc 7 escape > sequence excerpt I took from my bashrc, just disable dirtrack via > (shell-dirtrack-mode -1). > > function myprompt () { > printf "\e]7;file://%s%s\e\\" "$HOSTNAME" "$PWD" > } > > # Do these only if we're in an interactive shell > case $- in > *i*) > # ...snip... > export PROMPT_COMMAND=3Dmyprompt > > On Mon, Nov 25, 2024 at 1:56=E2=80=AFPM Eli Zaretskii wrot= e: > >> > From: Colton Goates >> > Date: Mon, 25 Nov 2024 10:27:00 -0700 >> > Cc: 74524@debbugs.gnu.org >> > >> > Coltons-MacBook-Pro:/Users/coltongoates/software-dev/$ isn't intended >> to be a directory name, it's a string >> > that's intended to look exactly like my prompt. (I know it's pretty >> contrived.) >> > >> > So, if someone prints something that resembles their prompt, dirtrack >> will change the directory, because >> > dirtrack thinks it just saw the shell prompt appear, but it really jus= t >> saw a string that resembles the prompt. >> > Does that make more sense now? >> >> What do you expect dirtrack to do when you deliberately try to deceive >> it? AFAIU, dirtrack is a piece of heuristic ad-hocery (as explained >> in its commentary), so it cannot be expected to survive such >> deception. What kind of changes would you suggest to consider to >> handle the cases such as this one? >> >> >> >> --00000000000058ba870627c7aa14 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I did what Ship Mints suggested, and it didn't wo= rk on my macbook i.e. no directory tracking is happening. I checked directo= ry tracking via the `default-directory` variable and it did not change in r= esponse to cd commands. I made sure to restart emacs to ensure that everyth= ing got loaded. I have Emacs 29.4 (installed with brew) and I'm running= macOS Sequoia 15.1.1. See below for my configuration:

Here is my .b= ashrc:
function myprompt () {=C2=A0 printf "\e]7;file://%s%s\e\\" "$HOSTNAME" &quo= t;$PWD"
}
export PROMPT_COMMAND=3Dmyprompt


And= I added this to my init.el
(add-hook 'comint-output-filter-functions #'comint-osc-process-ou= tput)

Does anyone have debugging tips?

On Mon, Nov 25, 2024 at 12:08=E2=80= =AFPM Ship Mints <shipmints@gmail= .com> wrote:
If you're usi= ng a shell that can support the following ansi osc 7 escape sequence excerp= t I took from my bashrc, just disable dirtrack=C2=A0via (shell-dirtrack-mod= e -1).

function myprompt () {
=C2=A0 printf "\e]7;fil= e://%s%s\e\\" "$HOSTNAME" "$PWD"
}

# Do = these only if we're in an interactive shell
case $- in
*i*)
# = ...snip...
=C2=A0 export PROMPT_C= OMMAND=3Dmyprompt

On Mon, Nov 25, 2024 at 1:56=E2=80=AFPM Eli Zare= tskii <eliz@gnu.org> wrote:
>= ; From: Colton Goates <coltongoates@gmail.com>
> Date: Mon, 25 Nov 2024 10:27:00 -0700
> Cc: 74524@d= ebbugs.gnu.org
>
> Coltons-MacBook-Pro:/Users/coltongoates/software-dev/$ isn't inten= ded to be a directory name, it's a string
> that's intended to look exactly like my prompt. (I know it's p= retty contrived.)
>
> So, if someone prints something that resembles their prompt, dirtrack = will change the directory, because
> dirtrack thinks it just saw the shell prompt appear, but it really jus= t saw a string that resembles the prompt.
> Does that make more sense now?

What do you expect dirtrack to do when you deliberately try to deceive
it?=C2=A0 AFAIU, dirtrack is a piece of heuristic ad-hocery (as explained in its commentary), so it cannot be expected to survive such
deception.=C2=A0 What kind of changes would you suggest to consider to
handle the cases such as this one?



--00000000000058ba870627c7aa14--