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: Tue, 26 Nov 2024 09:46:26 -0500 Message-ID: References: <86iksbij3m.fsf@gnu.org> <867c8ri1o8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001029bd0627d1ebea" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11755"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 74524@debbugs.gnu.org To: Colton Goates Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 26 15:48:29 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 1tFwrd-0002rD-Lr for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Nov 2024 15:48:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFwrE-0004kL-Ok; Tue, 26 Nov 2024 09:48: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 1tFwrC-0004jL-RF for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2024 09:48:02 -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 1tFwrC-0006WL-BO for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2024 09:48:02 -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=jKhp/EW1lAP91h6m/1lmd8hGOvzMBbVZf9UvLMILc5U=; b=alZMyezTZ3MBg+L1fnfJ54/+VAzC4T5hhC7IngPgdx8NEUfpwGzAPZ8tNaakaO3jb7F/J9xvcZ8Jyeugscw7nu9/7/Tn2Gf59tnjGFodX/jxXXbMHKzotztWiWisX4fuR9w/GX4HCqOvB4uhynOpm1uGFN7LkXwf/SSYmPmQPMYnj0c+4/gKJYGMsaHdE8LZl8U8M/l7NvxpvtZ0Vo/SnlIyAWCEKp4znEgbb0vMNcFHZq5u9XcAglVZ4X1qLQuLpoejgb9+DLBOfsSgSH5tCH8pA6wqImMSuOADIHdzk0SX3s5wQUIP8toEUCeJybQ+vrg8wiCHtt19jUbMOWPnVA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFwrB-0005tv-Ux for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2024 09:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Nov 2024 14:48:01 +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.173263247522667 (code B ref 74524); Tue, 26 Nov 2024 14:48:01 +0000 Original-Received: (at 74524) by debbugs.gnu.org; 26 Nov 2024 14:47:55 +0000 Original-Received: from localhost ([127.0.0.1]:48337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFwr4-0005tW-Gr for submit@debbugs.gnu.org; Tue, 26 Nov 2024 09:47:54 -0500 Original-Received: from mail-qt1-f171.google.com ([209.85.160.171]:43275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFwr2-0005tG-8Y for 74524@debbugs.gnu.org; Tue, 26 Nov 2024 09:47:53 -0500 Original-Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-4667cd408a6so23212891cf.1 for <74524@debbugs.gnu.org>; Tue, 26 Nov 2024 06:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732632405; x=1733237205; 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=jKhp/EW1lAP91h6m/1lmd8hGOvzMBbVZf9UvLMILc5U=; b=SSvI0tV6AduSkbO9e/EqtSXysedoh89HSlJcjMWPPL+qBtllS6UIxPOGsURBG0q+WC VMe3Iwg1p9jtZN/vTQHXDMC7d+3hFYT3ttkQ1k6cVAizv5k2P0H6As77q+R7gtpEuJga wlm1499fiY1n+kuNWBHZUr4FazQkLom0JRYjdZ4r+iBq7hIAmc+pcWBmJQP0ptJDUNe6 8+Pho6188ElHZGHzLLf1tXAof55IEf1s06hZk3ZXdJcVwHdIolQVAIb/2OJMEiet+NBH 5xDu7xAzshd6Tqw11a+5jPk6lec4WDGnpgYcJ5IkDngFATQsBFAzVl0//jRjqy8NSgCk bqJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732632405; x=1733237205; 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=jKhp/EW1lAP91h6m/1lmd8hGOvzMBbVZf9UvLMILc5U=; b=K2eldyE38kiVVwMC7aLGSSBydM4MSoq4mWgOh7ErkKxllCWDsyIS3A5o2VbHwwh6vf KQCWZqCOs+N8D+A2Mkeaixf7nV9vMlHUqJQ0WUvWAJWWA5kY9DW78/7tewlL57OsQt/Z 4kaCj1KMkLrthqgIl3W+F9Kr0NrT8HHe4CUKwJel/dSb9Ds4E3NLuD3QYe6AC7NZRC05 jydJVWtroGD6wLGFUj885s0GsdWISaBLqKHHMMtmyhblryiTbUBQqBP/xUENEbET3AnQ 5FcZsAsxNtjB1aOzw6EpaT2IXFPLQ6WEI26Aya/tZAG+DSHIsLldcUi6J/yvu3UCrhV7 cB7w== X-Forwarded-Encrypted: i=1; AJvYcCV9WpkgnonO5KTjeoOPLFSqXAwjyfOUIVIX94tCfLCKjEnntgUISPdT2VzEuDk8s+raWvfT3w==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyHfIN6j8FrDi1i7kgcTNk2JmNbqpNY/xpdSIbQfxCN8qNWIKEo JpBWhj1sgUrQOqyPxJt8MMdOonvKXn0vbq4cfbuMFOG9hf/IXL5ITqujGhpoWM3A47hrE0aJTdc T8D9ziitXJ7/mbeaCdffhyjnTuKA= X-Gm-Gg: ASbGncvs/Rqn3VdNfrtVUehr5NPiwgvyVbnnrSCGtMeRTKbYVVbBuUMZ2eWSUuaj5qB uX4xV1YbhtCBy7Bxh+5kwT5nAvpaPvN0= X-Google-Smtp-Source: AGHT+IEDvh5wErJW9Pvuma7niO1yK6MsLQ/UvnJy+yZqmFy28vjCX8K5q6CfoXXlwPBqBwOdbynb04qW+1CynJIfMOk= X-Received: by 2002:a05:622a:5c7:b0:466:9360:4933 with SMTP id d75a77b69052e-466a3bc77efmr65348541cf.27.1732632405601; Tue, 26 Nov 2024 06:46:45 -0800 (PST) In-Reply-To: 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:295991 Archived-At: --0000000000001029bd0627d1ebea Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable You can customize dirtrack-list to a regexp that can detect your prompt format. I'd still recommend using osc 7 support, though, as it's precise (once you get it working) and tracking pushd popd cd, parsing your prompt, etc. is not necessary. On Tue, Nov 26, 2024 at 3:16=E2=80=AFAM Colton Goates wrote: > I don't know how dirtrack would tell the difference between a prompt > output and other printed output. I just thought of the edge case and > decided to point it out in case someone knew of a solution. Thanks for > responding. > > On Mon, Nov 25, 2024 at 11:55=E2=80=AFAM Eli Zaretskii wro= te: > >> > 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? >> > --0000000000001029bd0627d1ebea Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You can customize dirtrack-list=C2=A0to a regexp=C2=A0that can detect yo= ur prompt format. I'd still recommend using osc 7 support, though, as i= t's precise (once you get it working) and tracking pushd popd cd, parsi= ng your prompt, etc. is not necessary.

On Tue, Nov 26, 2024 at 3:16=E2= =80=AFAM Colton Goates <colton= goates@gmail.com> wrote:
I don't know how dirtrack would tell t= he difference between a prompt output and other printed output. I just thou= ght of the edge case and decided to point it out in case someone knew of a = solution. Thanks for responding.

On Mon, Nov 25, 2024 at 11:55=E2=80=AFA= M Eli Zaretskii <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?
--0000000000001029bd0627d1ebea--