From 72c35f5518301907e0e518db0dd89bcd2fffa885 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Thu, 26 Jan 2012 11:50:11 +0100 Subject: [PATCH] fixes for mintty Ignore-this: 4bf6c68855167b1f094a4dde818bd000 darcs-hash:20120126105011-c41ad-159732298309c6e5e9846aed9047ec37e5c49d9c --- src/console/uTop_console.ml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/console/uTop_console.ml b/src/console/uTop_console.ml index 77358a1..e8daf76 100644 --- a/src/console/uTop_console.ml +++ b/src/console/uTop_console.ml @@ -218,16 +218,15 @@ let read_input_non_interactive prompt buffer len = Lwt_main.run (Lwt_io.write Lwt_io.stdout prompt >> loop 0) let init_read_interactive_input () = + (* Open the standard terminal. *) + lwt term = Lazy.force LTerm.stdout in (* If standard channels are connected to a tty, use interactive read-line and display a welcome message: *) - if Unix.isatty Unix.stdin && Unix.isatty Unix.stdout then begin - (* Open the standard terminal. *) - lwt term = Lazy.force LTerm.stdout in - + if LTerm.incoming_is_a_tty term && LTerm.outgoing_is_a_tty term then begin Toploop.read_interactive_input := (read_input term); (* Create a context to render the welcome message. *) - lwt size = LTerm.get_size term in + let size = LTerm.size term in let size = { rows = 3; cols = size.cols } in let matrix = LTerm_draw.make_matrix size in let ctx = LTerm_draw.context matrix size in