From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Devon Sean McCullough Newsgroups: gmane.emacs.devel Subject: Re: Shell-mode: File completion breaks editing previous commands Date: Tue, 8 Apr 2008 22:22:32 -0700 (PDT) Message-ID: <200804090522.m395MWrf057126@grant.org> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1207718698 29868 80.91.229.12 (9 Apr 2008 05:24:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Apr 2008 05:24:58 +0000 (UTC) Cc: Emacs-Devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 09 07:25:31 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JjSoG-0006Zo-8S for ged-emacs-devel@m.gmane.org; Wed, 09 Apr 2008 07:25:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjSnc-0008WQ-M9 for ged-emacs-devel@m.gmane.org; Wed, 09 Apr 2008 01:24:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JjSnV-0008TU-6N for emacs-devel@gnu.org; Wed, 09 Apr 2008 01:24:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JjSnT-0008Qq-5e for Emacs-Devel@gnu.org; Wed, 09 Apr 2008 01:24:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjSnS-0008QM-M6 for Emacs-Devel@gnu.org; Wed, 09 Apr 2008 01:24:34 -0400 Original-Received: from jovi.net ([206.190.173.18] helo=grant.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JjSnS-0002kT-IV for Emacs-Devel@gnu.org; Wed, 09 Apr 2008 01:24:34 -0400 Original-Received: from grant.org (localhost [127.0.0.1]) by grant.org (8.14.1/8.14.1) with ESMTP id m395MqXe057129 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Apr 2008 01:22:52 -0400 (EDT) (envelope-from Devon@Jovi.Net) Original-Received: (from devon@localhost) by grant.org (8.14.1/8.14.1/Submit) id m395MWrf057126; Tue, 8 Apr 2008 22:22:32 -0700 (PDT) (envelope-from Devon@Jovi.Net) X-Authentication-Warning: grant.org: devon set sender to Devon@Jovi.Net using -f Received-SPF: Pass (client IP white listed); receiver=localhost; client-ip=127.0.0.1; envelope-from= Received-SPF: Pass (client IP white listed); receiver=localhost; client-ip=127.0.0.1; helo= X-DCC--Metrics: grant.org 1114; Body=3 Fuz1=3 Fuz2=3 X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94754 Archived-At: Text properties break shell mode by making motion commands erratic and unpredictable, so all comint modes are now worse than useless. BOLD rendered as upper case for illustration ... $ LS BAr FOO foo $ FOO bash: ./foo: Permission denied $ HISTORY ... ls foo ... foo ... history $ ... your command got left-truncated, a variation on the usual lossage where return sends only command characters up to the next font change, then sends a newline, the remaining characters up to end of line are not sent, a potentially catastrophic failure. Peace --Devon /~\ \ / Health Care X not warfare / \ Dubya slime won the digital vote Kerry slime won the popular vote PS: Easier to show than tell so here's a movie, use EXTREME CAUTION and read before you run, it types commands at your shell! (require 'cl) (defun unread-string (string) (dolist (c (reverse (string-to-list string))) (push c unread-command-events))) (defun demo (&rest args) (let ((delay 0)) (dolist (keys args) (run-at-time delay nil 'unread-string keys) (incf delay 2)))) (demo "\exshell\r" "\e>\^C\^C" "\^Q\^C\r" "PS1='\\$ '\r" "mkdir /tmp/junk\r" "cd /tmp/junk\r" "touch foo bar\r" "echo bar\r" "\^P\^P" "\^F\^F" "\^F\^F" " f\t" "\r" "\^Roo " "\r" "\r" "history 9\r" "# That's all folks!")