Skip to content

Commit

Permalink
Fixed tput error (windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Aug 29, 2014
1 parent 3903110 commit 6c07141
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/opamMisc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,15 @@ let get_terminal_columns () =
try (* terminfo *)
with_process_in "tput cols"
(fun ic -> int_of_string (input_line ic))
with Unix.Unix_error _ | Sys_error _ | Failure _ -> try (* GNU stty *)
with Unix.Unix_error _ | Sys_error _ | Failure _ | End_of_file ->
try (* GNU stty *)
with_process_in "stty size"
(fun ic ->
match split (input_line ic) ' ' with
| [_ ; v] -> int_of_string v
| _ -> failwith "stty")
with Unix.Unix_error _ | Sys_error _ | Failure _ -> try (* shell envvar *)
with Unix.Unix_error _ | Sys_error _ | Failure _ | End_of_file ->
try (* shell envvar *)
int_of_string (getenv "COLUMNS")
with Not_found | Failure _ ->
default_columns
Expand Down

0 comments on commit 6c07141

Please sign in to comment.