unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ship Mints <shipmints@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Colton Goates <coltongoates@gmail.com>, 74524@debbugs.gnu.org
Subject: bug#74524: 29.4; dirtrack-mode
Date: Mon, 25 Nov 2024 14:08:30 -0500	[thread overview]
Message-ID: <CAN+1HbqBaMnaZ6jC+Eftedy+OwrYU73gy4zUBgGWE=0U5SkVkg@mail.gmail.com> (raw)
In-Reply-To: <867c8ri1o8.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

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=myprompt

On Mon, Nov 25, 2024 at 1:56 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Colton Goates <coltongoates@gmail.com>
> > 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 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?
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 2159 bytes --]

  reply	other threads:[~2024-11-25 19:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-25  3:55 bug#74524: 29.4; dirtrack-mode Colton Goates
2024-11-25 12:38 ` Eli Zaretskii
2024-11-25 17:27   ` Colton Goates
2024-11-25 18:55     ` Eli Zaretskii
2024-11-25 19:08       ` Ship Mints [this message]
2024-11-26  2:32         ` Colton Goates
2024-11-26  2:11       ` Colton Goates
2024-11-26 14:00         ` Ship Mints
2024-11-26 18:11           ` Colton Goates
2024-11-26 14:32         ` Eli Zaretskii
2024-11-26 14:46         ` Ship Mints
2024-11-26 18:05           ` Colton Goates

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN+1HbqBaMnaZ6jC+Eftedy+OwrYU73gy4zUBgGWE=0U5SkVkg@mail.gmail.com' \
    --to=shipmints@gmail.com \
    --cc=74524@debbugs.gnu.org \
    --cc=coltongoates@gmail.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).