utop icon indicating copy to clipboard operation
utop copied to clipboard

UTop drops commands while evaluating previous commands

Open obadz opened this issue 11 years ago • 1 comments

I have a setup with vim + slimux + tmux + utop 1.14

If I send these two lines to utop at the same time:

Unix.sleep 1;
true ;;

utop sleeps for a second and then displays:

- : bool = true

as you would expect.

However, if I send both lines individually, i.e. if I send true while Unix.sleep is being executed, the second line never gets evaluated:

Unix.sleep 1;
;;
true                                                                                                                                            
;;
- : unit = ()
─( 08:24:08 )─< command 70 >──{ counter: 0 }─

This is not specific to Unix.sleep: the same thing happens if I send two #mod_use one after the other for instance (only the first module gets loaded).

obadz avatar Aug 31 '14 12:08 obadz

Yes it's because to put the terminal in raw mode lambda-term is using Unix.tcsetattr stdin TCAFLUSH .... The TCAFLUSH means all pending input are discarded. Haven't thought whether it is safe to use something else, TCAFLUSH being the recommended parameter for changing input parameters.

ghost avatar Sep 01 '14 10:09 ghost