GNU bug report logs - #74524
29.4; dirtrack-mode

Previous Next

Package: emacs;

Reported by: Colton Goates <coltongoates <at> gmail.com>

Date: Mon, 25 Nov 2024 08:19:02 UTC

Severity: normal

Found in version 29.4

Full log


Message #23 received at 74524 <at> debbugs.gnu.org (full text, mbox):

From: Colton Goates <coltongoates <at> gmail.com>
To: Ship Mints <shipmints <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 74524 <at> debbugs.gnu.org
Subject: Re: bug#74524: 29.4; dirtrack-mode
Date: Mon, 25 Nov 2024 19:32:14 -0700
[Message part 1 (text/plain, inline)]
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=myprompt*

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 PM Ship Mints <shipmints <at> gmail.com> wrote:

> 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 <at> gnu.org> wrote:
>
>> > From: Colton Goates <coltongoates <at> gmail.com>
>> > Date: Mon, 25 Nov 2024 10:27:00 -0700
>> > Cc: 74524 <at> 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?
>>
>>
>>
>>
[Message part 2 (text/html, inline)]

This bug report was last modified 202 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.