GNU bug report logs - #79441
shell-resync-dirs breaks on PS1 with newline

Previous Next

Package: emacs;

Reported by: Janneke Nieuwenhuizen <janneke <at> gnu.org>

Date: Sat, 13 Sep 2025 06:53:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Janneke Nieuwenhuizen <janneke <at> gnu.org>
Cc: 79441 <at> debbugs.gnu.org
Subject: bug#79441: shell-resync-dirs breaks on PS1 with newline
Date: Sat, 13 Sep 2025 13:49:40 +0300
> From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
> Date: Sat, 13 Sep 2025 08:52:15 +0200
> 
> Hi!
> 
> It's great that shell-resync-dirs no longer hangs, but now (30.2) it
> breaks on my prompt:
> 
> --8<---------------cut here---------------start------------->8---
> PS1='$(_q=$?; if [ $_q != 0 ]; then echo "[$_q] ";fi)\t \u@\h:\w'" $PSG"'\n$ '
> --8<---------------cut here---------------end--------------->8---
> 
> saying
> 
>     Couldn’t cd: (wrong-type-argument stringp nil)
> 
> and failing to update the buffer's directory.
> 
> I've been using it for ages: It shows the last exit value if non-zero,
> the time, the user, pwd and uses a newline always leave plenty of typing
> space.  (PSG is set to "[env]" when inside a GUIX_ENVIRONMENT.)
> 
> Anyway, typing:
> 
>     PS1='$ '
> 
> (or even PS1='\w$ ') fixes it, i.e., M-RET works again.  To reproduce, a
> single character (that is not '.') and a newline suffices, typing
> something like:
> 
>     PS1='0\n$ '
> 
> in an emacs shell and typing M-RET reproduces the problem.

Can you suggest how to solve this?




This bug report was last modified 4 days ago.

Previous Next


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