GNU bug report logs -
#6800
23.1; EOT / ^D inserted into comint input string
Previous Next
Reported by: David Fox <ddssff <at> gmail.com>
Date: Thu, 5 Aug 2010 15:14:02 UTC
Severity: normal
Merged with 7078
Found in versions 23.1, 24.0.50, 24.0.90
Done: David Fox <ddssff <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Fri, 12 Aug 2016 11:40:03 -0700
with message-id <CAJN_RF4RQtWdP_E-yycZC4NQXzNU4zPKocg10ZYrKXcYm_snEw <at> mail.gmail.com>
and subject line Re: bug#6800: 23.1; EOT / ^D inserted into comint input string
has caused the debbugs.gnu.org bug report #6800,
regarding 23.1; EOT / ^D inserted into comint input string
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
6800: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6800
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
When an input longer than 255 characters is typed into comint (or
shell) an EOT character (ascii 4, ^D) is inserted into the string.
This can cause an error depending how the sub process handles these
extra characters. For example, GHC doesn't like it when an EOT
appears inside of a string:
ghci
> Prelude> putStrLn "<a 241 character string>"
works fine, but
> Prelude> putStrLn "<a 242 character string>"
<interactive>:1:255: lexical error at character '\EOT'
I inserted a function to break up the input into comint-send-string to work
around the problem:
(require 'comint)
(defun comint-send-string (process string)
"Like `process-send-string', but also does extra bookkeeping for Comint
mode."
(if process
(with-current-buffer (if (processp process)
(process-buffer process)
(get-buffer process))
(comint-snapshot-last-prompt))
(comint-snapshot-last-prompt))
(my-process-send-string process string))
;; Break up the string so that we don't get EOT characters in our input
stream.
(defun my-process-send-string (process string)
(if (> (length string) 200)
(progn (process-send-string process (substring string 0 200))
(my-process-send-string process (substring string 200)))
(process-send-string process string)))
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
[Message part 6 (text/plain, inline)]
On Fri, Aug 12, 2016 at 11:36 AM, Alan Third <alan <at> idiocy.org> wrote:
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
> >> When an input longer than 255 characters is typed into comint (or
> >> shell) an EOT character (ascii 4, ^D) is inserted into the string.
> >> This can cause an error depending how the sub process handles these
> >> extra characters. For example, GHC doesn't like it when an EOT
> >> appears inside of a string:
> >
> > I believe this bug is fixed on the Emacs trunk (to become Emacs-24), but
> > the fix may introduce other problems. Apparently nobody knows how to
> > fix it right and there is about as much as no documentation at all on
> > this part of the behavior of ttys.
>
> IIRC this code is no longer in Emacs. I'll close this bug.
>
> --
> Alan Third
>
I do know that commands longer than 4096 characters are truncated in emacs
24.3.1
[Message part 7 (text/html, inline)]
This bug report was last modified 8 years and 286 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.