[Top][All Lists]

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100961: Enable ICANON (Bug#6771)

From: Jan Djärv
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r100961: Enable ICANON (Bug#6771). Any long line problem must be solved differently.
Date: Fri, 06 Aug 2010 19:12:09 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv: Gecko/20100802 Thunderbird/3.1.2

Jan Djärv skrev 2010-08-06 16.30:

Stefan Monnier skrev 2010-08-06 15.03:
I agree with the commit that reverts my ICANON change. Yet:
There is AFAIK no bug report or test case for the long line problem.
AFAIK, the missing bug-report is the one that shows the ills of sending
EOFs, while the bug-report for long-lines is bug#6149, which should be

As I said in relation to this, I could not reproduce the error in 6149.

I could and still can:

emacs -Q
M-x shell
SPC C-u 5000 a
| wc

and instead of getting wc's output I just get 4090 "a"s
(the command appears to get cut at 4096 chars). The shell is `zsh', but
last time I tried, the result was the same with bash.

It is definitly a shell thing. I tried with 100000 and bash: No problem.
It could be the tty driver that does things differently, but I tested on OSX
and Fedora 12.

I tried with zsh, then I get
zsh: command too long: ...

It really doesn't matter if Emacs sets icanon or not for bash at least and
probably most shells that use command line editing. Those shells will turn off
icanon while reading input, and only turn it on when a command is executed.

I think this is a non-issue. Emacs should not try to work around limitations set by the tty driver. Pty:s are not a general communication mechanism, they are supposed to emulate a terminal. I mean try this:

% read x ; echo "$x" > out

and type in a lot of input. You simply can't get more than about 4096 characters into out. If you want more, use pipes.

Even if Emacs sets the tty to raw input, there is no guarantee that the subprocess doesn't set it back. If a subprocess wants to read a lot of stuff from a tty input, it better put that tty into raw mode itself, like bash does.

There isn't a way for Emacs to detect this, the write from Emacs may indeed return success, but the tty driver silently discards the input. I say just document it and close these bug reports.

        Jan D.

reply via email to

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