On Sat, Aug 29, 2009 at 11:54 PM, Trent W. Buck<[email protected]> wrote: > On Sat, Aug 29, 2009 at 11:19:19PM -0700, Judah Jacobson wrote: >>> I'm not applying it immediately because I first want to hear >>> Judah's views on handling "stty -echo" directly in haskeline (I >>> suspect it's not as trivial as it sounds). >> >> Haskeline relies on echoing already being off so that it can detect >> that it's inside an emacs-shell-like environment and behave >> correctly. (This is tricky to get right because "M-x shell" >> pretends to be a terminal but does not, e.g., provide unbuffered >> input to programs run inside of it.) > > Wouldn't it be better to check TERM=dumb (or even $EMACS and > $INSIDE_EMACS) for that?
I'd prefer to avoid putting emacs-specific hacks into the library. One thing I like about the existing solution is that if echoing has been turned off in a real tty, not presenting an interactive UI is still acceptable behavior. (Note that readline uses this same trick.) With respect to TERM=dumb, I've followed the cue of readline/bash/zsh/etc. Any TERM type which doesn't contain a sufficient set of display capabilities (this includes "dumb", "vanilla", etc.) is treated as a "dumb" terminal which provides the full set of keybindings but keeps the input interface to only one line. (To see what that looks like, set TERM=dumb and then enter a long line in bash or ghci.) Best, -Judah _______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
