emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell-mode: File completion breaks editing previous commands


From: Devon Sean McCullough
Subject: Re: Shell-mode: File completion breaks editing previous commands
Date: Tue, 8 Apr 2008 22:22:32 -0700 (PDT)

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!")




reply via email to

[Prev in Thread] Current Thread [Next in Thread]