[Haskell-cafe] Interaction in Haskell

Glynn Clements glynn at gclements.plus.com
Mon Jul 11 16:00:30 EDT 2005

Dinh Tien Tuan Anh wrote:

> > Yes, it is certainly not Hugs which prevents from realtime interaction but
> > it is the terminal you are using. If the terminal lets you delete the
> > characters on the current line it has to keep them until you complete it
> > with ENTER.  Piping from and to other programs or files may not have this
> > problem.
> You're right, i've been using shell in Emacs to run Hugs, but when back to 
> normal terminal, it works.
> Just for curiousity, why does it happen ?

Emacs' shell-mode doesn't send anything to the terminal driver until
you hit Return, at which point it sends the whole line.

Note that the terminal driver itself normally does line-buffering,
although this is disabled if you set the buffering for stdin to

You can't disable the line-buffering inherent in Emacs' shell-mode;
you would have to use terminal-emulator instead ("M-x term" instead of
"M-x shell").

Glynn Clements <glynn at gclements.plus.com>

More information about the Haskell-Cafe mailing list