From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.bugs Subject: bug#74524: 29.4; dirtrack-mode Date: Mon, 25 Nov 2024 14:08:30 -0500 Message-ID: References: <86iksbij3m.fsf@gnu.org> <867c8ri1o8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007b85330627c17651" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24687"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Colton Goates , 74524@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 25 20:10:34 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 1tFeTi-0006FV-Jr for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Nov 2024 20:10:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFeTJ-00079x-Mi; Mon, 25 Nov 2024 14:10:10 -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 1tFeTD-00077g-OV for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 14:10: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 1tFeTD-00058H-Fb for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 14:10: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=nc+EQgyVPb7KfW/bp7TESnIO3XtdLwVOkJUNVw9uIqM=; b=r9RaQusJR6JFFatOGX40iQkiEj1ob2mqNnHqQt5xLmz6o16NovUtY1mzDLLHNB7KUusD8oHEbgKZJPUXeoJj8iXB4MbWwUNp8pYIw8tuVDkrVNF91ZqAx4j09i0sDU3wsRI9EhhBqhaMBRmqBnqdCZit4/Va0DudG7l62I+4IOBKWAPnLNv2Oc+/4TBWuwABLKv209V96FJPifT8vHiIXX/3cc+VV3dHPXYEv5le/Q1nWaK2U2hFsNd3JkTnKunvZvsfn6rpFhPzUR0VyCbIC9fOkPBK5pIdlJbbJDNc+iFx02Dnh6fYFXnXl5dF0lmFm+yfK9XlDnsEW0m55ciTrQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFeTC-0007Tb-GQ for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 14:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Nov 2024 19:10: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.173256179328715 (code B ref 74524); Mon, 25 Nov 2024 19:10:02 +0000 Original-Received: (at 74524) by debbugs.gnu.org; 25 Nov 2024 19:09:53 +0000 Original-Received: from localhost ([127.0.0.1]:40747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFeT3-0007T5-CJ for submit@debbugs.gnu.org; Mon, 25 Nov 2024 14:09:53 -0500 Original-Received: from mail-ot1-f53.google.com ([209.85.210.53]:50584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFeT1-0007Sv-FU for 74524@debbugs.gnu.org; Mon, 25 Nov 2024 14:09:52 -0500 Original-Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-71d554dedc6so418138a34.1 for <74524@debbugs.gnu.org>; Mon, 25 Nov 2024 11:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732561730; x=1733166530; 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=nc+EQgyVPb7KfW/bp7TESnIO3XtdLwVOkJUNVw9uIqM=; b=dcQx6XnxuD9N29C5WthrxPabsYWe8iqlucTGQkYEx0CdqUZxM0qR+FLNg4KD1ACjbO lv89F+i1VOb+NP3EFVBPXXKgdKN4Mm1EzTm28ZZ7/gvdTzCtN/c8NBGbb72++u+CSIYt 5jJn1JLn5Sp8E0x6o2S7kYYronXMfEBJ2T9Z3bN/I8rUFLmcuD/O3eCVsTGMxB5a+i8K lBKeVaMDkZsHiqFFLA9JdCXM3ndb//pRH4mnRD4E24U2rENZf081te8Hi4ffK0Z4tp5b qjAZ4WuiN/t6KHkrLmlI+UhEjVIG5dcrnXmSIjv3AiRtOUbDv56WLs1bLfHam2ayJ+ST sg6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732561730; x=1733166530; 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=nc+EQgyVPb7KfW/bp7TESnIO3XtdLwVOkJUNVw9uIqM=; b=QEdOIJLK+P114WLprBumTIcWyp6UgMgfveVx2ZTXFs8Ud95GUcuRgtEzS9cw+bLzIf MsZo36pELcrWxREZ1AZ8XRdzt8DySQa1lPRG2se5eCQy2BLvTOi2llRnDgluxCYuB14E 3et+/zBUc19dv9bGQBSbRsKc/RqdUXQ0J0W7fKT7DoVu9WNBnKEXACqUrPzDlwQ5Dr9i N9T2ZNXmT9CB0WcsaydclLmvhxEZxffC1PrRpZVejruOxek2bk/iWlb2+KyZISRwXmFJ CykXvkWQv44f7jRSXC7BxCv469ASJH3Ihn8tRsDjiNWEMOXsHOa3ouTwwolc7sovwdAP 6WtQ== X-Forwarded-Encrypted: i=1; AJvYcCWBtCX89DkgbW6woo8CvC1kQjhrOdowDKkUtQ2OrSNo19qFV4mHw+Cd7GTQ0plwDRxFP2Oamg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxOx8TBUQF7WLlyJnv+P4jG4aIl88wzWbMmUZ9zGYrVLNm7IPvx e3PhLCEjDb15O6gzrA6lKiTSXroLm9ZDYxN+kpZGnsL9zuNibUpGIZJFlYUpC9lNG4X0uxRLBp8 3B6wlsk4m1QzJ++7IiMVlwKE2c3Q= X-Gm-Gg: ASbGncscGbLh/1HO1E5z5Zo0TKsnNLy8MN8z1b2oZ2qx9ngqZLvU95Jo3b5Om7uHxoZ bvOXJJOTg73acFWRTcat9Ir4XmD9+lSI= X-Google-Smtp-Source: AGHT+IEswzysM9Fthniu04vFfACOYYa0+wxbx4zWfxnN7roAzzmzDgkHf7L1h4p5Ckn2ZfRnrV8nr9j34qRYmSf9iKU= X-Received: by 2002:a05:6218:260a:b0:1c3:9d1e:842 with SMTP id e5c5f4694b2df-1ca797d4f1cmr679410555d.20.1732561730238; Mon, 25 Nov 2024 11:08:50 -0800 (PST) In-Reply-To: <867c8ri1o8.fsf@gnu.org> 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:295953 Archived-At: --0000000000007b85330627c17651 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 wrote: > > 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 t= o > 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 just > 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? > > > > --0000000000007b85330627c17651 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If you're using a shell that can support the following ansi osc 7 es= cape sequence excerpt I took from my bashrc, just disable dirtrack=C2=A0via= (shell-dirtrack-mode -1).

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

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

On Mon, Nov 25, 2024 at 1:56= =E2=80=AFPM Eli Zaretskii <eliz@gnu.org<= /a>> wrote:
&= gt; 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?



--0000000000007b85330627c17651--