GNU bug report logs - #13963
24.3; eshell: "Text is read-only" and unresponsive eshell to kill-buffer, C-x C-c and C-x C-q

Previous Next

Package: emacs;

Reported by: joe M <joe9mail <at> gmail.com>

Date: Thu, 14 Mar 2013 19:38:02 UTC

Severity: important

Merged with 17563

Found in version 24.3

Fixed in version 24.4

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#13963: 24.3;
	eshell: "Text is read-only" and unresponsive eshell to kill-buffer,
	C-x C-c and C-x C-q
Date: Sun, 17 Mar 2013 13:18:25 +0100
Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:

> joe M <joe9mail <at> gmail.com> writes:
>
>> Reproducing the bug:
>>
>> 1. Type something right after the '$' in the prompt without a space. For
>> example, '$pwd' instead of '$ pwd'. That causes the "Text is read-only"
>> message.
>> 2. Cannot close out of eshell or emacs when that message appears
>> 3. The only way to close out of eshell/emacs is:
>> <taylanub> joe9: M-: (let ((inhibit-read-only t)) (kill-this-buffer)) in the
>>            eshell buffer.
>> <taylanub> To recover after the bug triggers, that is, not to solve the bug ..
>> <jlf> joe9: you can also C-x C-e after forms such as taylanub's if you get
>>       into a situation where M-: doesn't function  [14:59]
>>
>>
>
> The problem I think is that the eshell prompt is read-only but this
> doesn't forbid user to write in this zone and because the prompt have
> also rear-nonsticky property, the new character entered are made
> read-only and eshell when it try to delete this characters return "text
> read only".
> Didn't look deeper where this happen though.

Fix the problem by making the prompt region read-only.

diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index c1c4d47..ac3649d 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -119,11 +119,12 @@ arriving, or after."
       (set-marker eshell-last-output-end (point))
     (let ((prompt (funcall eshell-prompt-function)))
       (and eshell-highlight-prompt
-	   (add-text-properties 0 (length prompt)
-				'(read-only t
-				  face eshell-prompt
-				  rear-nonsticky (face read-only))
-				prompt))
+	   (add-text-properties 0
+                                ;; Assume `eshell-prompt-function'
+                                ;; add a space at end of prompt.
+                                (1- (length prompt))
+                                '(read-only t face eshell-prompt)
+                                prompt))
       (eshell-interactive-print prompt)))
   (run-hooks 'eshell-after-prompt-hook))

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





This bug report was last modified 10 years and 364 days ago.

Previous Next


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