unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43772: 27.1; (describe-variable) breaks eshell
@ 2020-10-03  2:11 daniel
  2020-10-05  8:09 ` Lars Ingebrigtsen
  2020-11-15 14:13 ` bug#43772: Fix for bug#43772 Ruthra Kumar
  0 siblings, 2 replies; 5+ messages in thread
From: daniel @ 2020-10-03  2:11 UTC (permalink / raw)
  To: 43772

When using eshell-mode, calling `(describe-variable)` on a variable that
starts with "eshell" causes eshell-watch-for-password-prompt to no
longer function correctly.  In the attached dribble file, I first show
the correct behavior by opening eshell and entering `sudo ls`; eshell
correctly prompts me for a password three times.  I then run
`(describe-variable 'eshell-after-prompt-hook)` and then enter `sudo
ls`.  This time, eshell displays the incorrect behavior: it prints the
string "password" but does not accept input as a password or print any
output from the command.  I selected `eshell-after-prompt-hook` becuase
it is one of the first variables starting with "eshell", but the same
behavior occurs with other variables, including user-defined ones.

The information below, generated with report-emacs-bug, is for my
laptop, where I observed the above bug on Emacs 27.1.  I also observed
the same bug on my desktop on Emacs 26.3 (build 2, x86_64-pc-linux-gnu),
so the issue isn't specific to the Void musl build.

I hope this information is helpful.  Thank you all for the wonderful
work you do on Emacs, and please let me know if I can provide any other
information.

Best regards,
Daniel 

In GNU Emacs 27.1 (build 1, x86_64-unknown-linux-musl)
 of 2020-08-12 built on vm1-a-mci-us
System Description: void

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list... [3 times]

Configured using:
 'configure --without-x --without-dbus --prefix=/usr --sysconfdir=/etc
 --sbindir=/usr/bin --bindir=/usr/bin --mandir=/usr/share/man
 --infodir=/usr/share/info --localstatedir=/var
 --with-file-notification=inotify --with-modules --with-jpeg --with-tiff
 --with-gif --with-png --with-xpm --with-rsvg --without-imagemagick
 --with-xml2 --with-gnutls --with-sound --with-m17n-flt --with-json
 --without-harfbuzz --without-cairo --with-libgmp
 --host=x86_64-unknown-linux-musl --build=x86_64-unknown-linux-musl
 'CFLAGS=-fno-PIE -mtune=generic -O2 -pipe -g' 'CPPFLAGS= '
 'LDFLAGS=-no-pie -Wl,--as-needed ''

Configured features:
SOUND NOTIFY INOTIFY ACL GNUTLS LIBXML2 ZLIB XIM MODULES THREADS JSON
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: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  menu-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:
None found.

Features:
(shadow regexp-opt sort mail-extr emacsbug message rmc puny dired
dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache
epa derived epg epg-config gnus-util rmail tool-bar rmail-loaddefs
text-property-search seq mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils time-date subr-x cl-loaddefs
cl-lib term/xterm xterm byte-opt gv bytecomp byte-compile cconv tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select 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 inotify lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 46396 8814)
 (symbols 48 6012 1)
 (strings 32 15639 1721)
 (string-bytes 1 506946)
 (vectors 16 8020)
 (vector-slots 8 86910 7560)
 (floats 8 23 290)
 (intervals 56 209 0)
 (buffers 1000 12))





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

* bug#43772: 27.1; (describe-variable) breaks eshell
  2020-10-03  2:11 bug#43772: 27.1; (describe-variable) breaks eshell daniel
@ 2020-10-05  8:09 ` Lars Ingebrigtsen
  2020-10-07  5:43   ` Lars Ingebrigtsen
  2020-11-15 14:13 ` bug#43772: Fix for bug#43772 Ruthra Kumar
  1 sibling, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-05  8:09 UTC (permalink / raw)
  To: daniel; +Cc: 43772

daniel@codesections.com writes:

> When using eshell-mode, calling `(describe-variable)` on a variable that
> starts with "eshell" causes eshell-watch-for-password-prompt to no
> longer function correctly.  In the attached dribble file, I first show
> the correct behavior by opening eshell and entering `sudo ls`; eshell
> correctly prompts me for a password three times.  I then run
> `(describe-variable 'eshell-after-prompt-hook)` and then enter `sudo
> ls`.  This time, eshell displays the incorrect behavior: it prints the
> string "password" but does not accept input as a password or print any
> output from the command. 

There was no dribble file attached, but I was able to reproduce the bug
in Emacs 28, too.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#43772: 27.1; (describe-variable) breaks eshell
  2020-10-05  8:09 ` Lars Ingebrigtsen
@ 2020-10-07  5:43   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-07  5:43 UTC (permalink / raw)
  To: daniel; +Cc: 43772

Lars Ingebrigtsen <larsi@gnus.org> writes:

> There was no dribble file attached, but I was able to reproduce the bug
> in Emacs 28, too.

A simpler way to reproduce the bug is to say

(require 'em-tramp)

This is because that file defines eshell/su, and when that's defined,
the command is passed onto the shell directly without any parsing (and
therefore no prompting).

The logic is in

(defun eshell-invoke-directly (command)
...
	 (fboundp (intern-soft (concat "eshell/" name))))))

I'm not an eshell user, so I'm not sure what's up with that?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#43772: Fix for bug#43772
  2020-10-03  2:11 bug#43772: 27.1; (describe-variable) breaks eshell daniel
  2020-10-05  8:09 ` Lars Ingebrigtsen
@ 2020-11-15 14:13 ` Ruthra Kumar
  2020-11-16 22:06   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 5+ messages in thread
From: Ruthra Kumar @ 2020-11-15 14:13 UTC (permalink / raw)
  To: 43772

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

Hello Lars,

As you've mentioned, parsing ( and prompting ) is not done, when
command is sent directly to shell. But, i think
'eshell-invoke-directly' should not have returned true for sudo and
su. Comment section in 'eshell-find-alias-function' best describes it,

(defun eshell-find-alias-function (name)
 ...
    ;; If the function exists, but is defined in an eshell module
    ;; that's not currently enabled, don't report it as found.

eshell-tramp is disabled by default. So, eshell-invoke-directly should
return nil for su and sudo ( I'm new to eshell as well. So, I might be
wrong here ). Replacing fboundp with 'eshell-find-alias-function'
should fix this. So far, I've tested locally and it is working fine.

Patch attached.

Regards
Ruthra Kumar

[-- Attachment #2: 0001-eshell-invoke-directly-use-eshell-find-alias-functio.patch --]
[-- Type: text/x-patch, Size: 802 bytes --]

From fa4b5f71f8d0f4ea43ab9cade8b6a721dc21d604 Mon Sep 17 00:00:00 2001
From: Ruthra Kumar <ruthrab@gmail.com>
Date: Sun, 15 Nov 2020 16:31:05 +0530
Subject: [PATCH] (eshell-invoke-directly) - use 'eshell-find-alias-function'
 instead of fboundp

---
 lisp/eshell/esh-cmd.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index e0348ba501..e54caf46fc 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -920,7 +920,7 @@ eshell-invoke-directly
 		       (funcall pred name))
 		  (throw 'simple nil)))
 	    t))
-	 (fboundp (intern-soft (concat "eshell/" name))))))
+	 (eshell-find-alias-function name))))
 
 (defun eshell-eval-command (command &optional input)
   "Evaluate the given COMMAND iteratively."
-- 
2.28.0


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

* bug#43772: Fix for bug#43772
  2020-11-15 14:13 ` bug#43772: Fix for bug#43772 Ruthra Kumar
@ 2020-11-16 22:06   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-16 22:06 UTC (permalink / raw)
  To: Ruthra Kumar; +Cc: 43772

Ruthra Kumar <ruthrab@gmail.com> writes:

> eshell-tramp is disabled by default. So, eshell-invoke-directly should
> return nil for su and sudo ( I'm new to eshell as well. So, I might be
> wrong here ). Replacing fboundp with 'eshell-find-alias-function'
> should fix this. So far, I've tested locally and it is working fine.

Thanks; I tested it and it fixes the reported case, while apparently
having no other obvious negative effects, so I've applied it to Emacs
28.  (I'm not overly familiar with how eshell is supposed to work,
though...)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2020-11-16 22:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-03  2:11 bug#43772: 27.1; (describe-variable) breaks eshell daniel
2020-10-05  8:09 ` Lars Ingebrigtsen
2020-10-07  5:43   ` Lars Ingebrigtsen
2020-11-15 14:13 ` bug#43772: Fix for bug#43772 Ruthra Kumar
2020-11-16 22:06   ` Lars Ingebrigtsen

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