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

From: Stefan Monnier <[email-masked]>
Date: Sat, 23 Mar 2013 11:58:52 -0400

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

The problem is that the last char of the prompt (the space) should be
rear-nonsticky, but if the others are rear-nonsticky and are not
front-sticky, then indeed you can't erase them but you can insert
anything inside them.  So I think the better fix is to make the prompt
(including the trailing space) both rear-nonsticky and front-sticky.

Does the patch below fix the problem?

        Stefan

=== modified file 'lisp/eshell/em-prompt.el'
--- lisp/eshell/em-prompt.el	2013-01-01 09:11:05 +0000
+++ lisp/eshell/em-prompt.el	2013-03-23 15:57:29 +0000
@@ -122,6 +122,7 @@
 	   (add-text-properties 0 (length prompt)
 				'(read-only t
 				  face eshell-prompt
+				  front-sticky (face read-only)
 				  rear-nonsticky (face read-only))
 				prompt))
       (eshell-interactive-print prompt)))