unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53927: 27.2; shell-mode dir tracking falls out of sync after popd in remote buffers
@ 2022-02-10 20:18 Dan McCarthy
  2022-02-15 13:39 ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Dan McCarthy @ 2022-02-10 20:18 UTC (permalink / raw)
  To: 53927

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

Create a remote shell-mode buffer with C-u M-x shell, using bash as the
remote shell. pushd into another directory, then popd
back. default-directory and shell-dirstack still have the other
directory even though the popd took effect in the remote process.

The problem seems to be that shell-prefixed-directory-name returns a
string like "/ssh:dan@solstice:/ssh:dan@solstice:/home/dan/Documents/",
doubling the remote prefix.

Local shell-mode buffers do not have the problem.


In GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2021-03-25 built on october
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Slackware 15.0 x86_64

Recent messages:
Checking 113 files in /usr/local/share/emacs/27.2/lisp/obsolete...
Checking for load-path shadows...done
You can run the command ‘report-emacs-bug’ with M-x r-em RET
Checking for load-path shadows...done
Auto-saving...
Mark saved where search started
Making completion list...
nil
~/Documents ~/Documents
Making completion list...
("/ssh:dan@solstice:/home/dan/Documents/")
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY
ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS GTK3
X11 XDBE XIM MODULES THREADS PDUMPER LCMS2 GMP

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  hexl-follow-ascii: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
~/emacs-lisp/dictionary-el/link hides ~/.emacs.d/lisp/link
~/emacs-lisp/dictionary-el/connection hides ~/.emacs.d/lisp/connection
~/.emacs.d/lisp/android-mode hides
/home/blakestone/.emacs.d/elpa/android-mode-20140716.2347/android-mode
~/emacs-lisp/dictionary-el/dictionary hides
/home/blakestone/.emacs.d/elpa/dictionary-20201001.1727/dictionary
~/emacs-lisp/dictionary-el/dictionary-pkg hides
/home/blakestone/.emacs.d/elpa/dictionary-20201001.1727/dictionary-pkg
~/emacs-lisp/dictionary-el/connection hides
/home/blakestone/.emacs.d/elpa/connection-20191111.446/connection
~/emacs-lisp/dictionary-el/link hides
/home/blakestone/.emacs.d/elpa/link-20191111.446/link
~/.emacs.d/lisp/greek hides /usr/local/share/emacs/27.2/lisp/language/greek
~/.emacs.d/lisp/longlines hides
/usr/local/share/emacs/27.2/lisp/obsolete/longlines

Features:
(shadow sort mail-extr emacsbug sendmail debug ibuf-ext ibuffer
ibuffer-loaddefs loadhist edebug backtrace jka-compr eieio-opt speedbar
sb-image ezimage dframe make-mode c-eldoc cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
magit-extras bug-reference magit-svn face-remap calc-undo calc-alg
calc-ext calc-menu calc calc-loaddefs calc-macs apropos cus-edit
wid-edit pcmpl-gnu vc-git reveal magit-submodule magit-obsolete
magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull
magit-fetch magit-clone magit-remote magit-commit magit-sequence
magit-notes magit-worktree magit-tag magit-merge magit-branch
magit-reset magit-files magit-refs magit-status magit magit-repos
magit-apply magit-wip magit-log which-func magit-diff smerge-mode diff
diff-mode git-commit log-edit easy-mmode message rmc puny rfc822 mml
mml-sec epa epg epg-config gnus-util rmail rmail-loaddefs
text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert
autorevert filenotify magit-margin magit-transient magit-process
magit-mode transient magit-git magit-section magit-utils crm dash
sh-script smie pcmpl-unix mule-util diary-lib diary-loaddefs cal-menu
calendar cal-loaddefs with-editor tramp-cache tramp-sh tabify imenu man
pp cl-print mode-local find-func help-fns radix-tree iso-transl
executable grep rst dired dired-loaddefs misearch multi-isearch edmacro
kmacro paren cua-base cus-start cus-load acme-search quack thingatpt
compile cmuscheme scheme advice tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat shell pcomplete comint ring
parse-time iso8601 time-date ls-lisp format-spec ansi-color c-xref rx
session vanc-init bindat vanc-mode hexl ecf-mode derived cl-extra
help-mode dcm-general server cl android-mode-autoloads
go-eldoc-autoloads go-mode-autoloads sml-mode-autoloads
svg-clock-autoloads info package easymenu browse-url url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 407981 70581)
 (symbols 48 39873 4)
 (strings 32 146293 9854)
 (string-bytes 1 4078275)
 (vectors 16 49007)
 (vector-slots 8 1677838 74592)
 (floats 8 138 289)
 (intervals 56 43227 1568)
 (buffers 1000 57)
 (heap 1024 50828 7177))

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#53927: 27.2; shell-mode dir tracking falls out of sync after popd in remote buffers
  2022-02-10 20:18 bug#53927: 27.2; shell-mode dir tracking falls out of sync after popd in remote buffers Dan McCarthy
@ 2022-02-15 13:39 ` Michael Albinus
  2022-02-15 15:29   ` Dan McCarthy
  2022-02-15 16:41   ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Albinus @ 2022-02-15 13:39 UTC (permalink / raw)
  To: Dan McCarthy; +Cc: 53927

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

Dan McCarthy <daniel.c.mccarthy@gmail.com> writes:

Hi Dan,

> Create a remote shell-mode buffer with C-u M-x shell, using bash as
> the
> remote shell. pushd into another directory, then popd
> back. default-directory and shell-dirstack still have the other
> directory even though the popd took effect in the remote process.
>
> The problem seems to be that shell-prefixed-directory-name returns a
> string like
> "/ssh:dan@solstice:/ssh:dan@solstice:/home/dan/Documents/",
> doubling the remote prefix.
>
> Local shell-mode buffers do not have the problem.

Thanks for the bug report, I could reproduce it locally. The appended
patch fixes this for me, could you please check?

Eli, it is a very simple patch. Any chance to commit it to the emacs-28
branch? Otherwise, I would commit it to master, but we need a marker to
merge it back to the emacs-28 branch after the Emacs 28.1 release.

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 489 bytes --]

diff --git a/lisp/shell.el b/lisp/shell.el
index c0a82bca18..6198214abe 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -942,7 +942,7 @@ shell-prefixed-directory-name
       dir
     (if (file-name-absolute-p dir)
 	;; The name is absolute, so prepend the prefix.
-	(concat comint-file-name-prefix dir)
+	(concat comint-file-name-prefix (file-local-name dir))
       ;; For relative name we assume default-directory already has the prefix.
       (expand-file-name dir))))


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#53927: 27.2; shell-mode dir tracking falls out of sync after popd in remote buffers
  2022-02-15 13:39 ` Michael Albinus
@ 2022-02-15 15:29   ` Dan McCarthy
  2022-02-15 16:41   ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Dan McCarthy @ 2022-02-15 15:29 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 53927

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

The patch fixes it for me too. Thanks!

On Tue, Feb 15, 2022 at 8:39 AM Michael Albinus <michael.albinus@gmx.de>
wrote:

> Dan McCarthy <daniel.c.mccarthy@gmail.com> writes:
>
> Hi Dan,
>
> > Create a remote shell-mode buffer with C-u M-x shell, using bash as
> > the
> > remote shell. pushd into another directory, then popd
> > back. default-directory and shell-dirstack still have the other
> > directory even though the popd took effect in the remote process.
> >
> > The problem seems to be that shell-prefixed-directory-name returns a
> > string like
> > "/ssh:dan@solstice:/ssh:dan@solstice:/home/dan/Documents/",
> > doubling the remote prefix.
> >
> > Local shell-mode buffers do not have the problem.
>
> Thanks for the bug report, I could reproduce it locally. The appended
> patch fixes this for me, could you please check?
>
> Eli, it is a very simple patch. Any chance to commit it to the emacs-28
> branch? Otherwise, I would commit it to master, but we need a marker to
> merge it back to the emacs-28 branch after the Emacs 28.1 release.
>
> Best regards, Michael.
>
>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#53927: 27.2; shell-mode dir tracking falls out of sync after popd in remote buffers
  2022-02-15 13:39 ` Michael Albinus
  2022-02-15 15:29   ` Dan McCarthy
@ 2022-02-15 16:41   ` Eli Zaretskii
  2022-02-15 17:19     ` Michael Albinus
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2022-02-15 16:41 UTC (permalink / raw)
  To: Michael Albinus; +Cc: daniel.c.mccarthy, 53927

> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Tue, 15 Feb 2022 14:39:37 +0100
> Cc: 53927@debbugs.gnu.org
> 
> Eli, it is a very simple patch. Any chance to commit it to the emacs-28
> branch?

Yes, please.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#53927: 27.2; shell-mode dir tracking falls out of sync after popd in remote buffers
  2022-02-15 16:41   ` Eli Zaretskii
@ 2022-02-15 17:19     ` Michael Albinus
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2022-02-15 17:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: daniel.c.mccarthy, 53927-done

Version: 28.1

Eli Zaretskii <eliz@gnu.org> writes:

>> Eli, it is a very simple patch. Any chance to commit it to the emacs-28
>> branch?
>
> Yes, please.

Done, closing the bug.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-15 17:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 20:18 bug#53927: 27.2; shell-mode dir tracking falls out of sync after popd in remote buffers Dan McCarthy
2022-02-15 13:39 ` Michael Albinus
2022-02-15 15:29   ` Dan McCarthy
2022-02-15 16:41   ` Eli Zaretskii
2022-02-15 17:19     ` Michael Albinus

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).