File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,11 @@ class MlNodeFd extends MlFile {
419419 }
420420 }
421421
422+ isatty ( ) {
423+ var tty = require ( "node:tty" ) ;
424+ return tty . isatty ( this . fd ) ? 1 : 0 ;
425+ }
426+
422427 length ( ) {
423428 try {
424429 return this . fs . fstatSync ( this . fd ) . size ;
Original file line number Diff line number Diff line change @@ -98,15 +98,12 @@ function caml_unix_filedescr_of_fd(x) {
9898}
9999
100100//Provides: caml_unix_isatty
101- //Requires: fs_node_supported, caml_unix_lookup_file
101+ //Requires: caml_unix_lookup_file
102102//Alias: unix_isatty
103103function caml_unix_isatty ( fd ) {
104- if ( fs_node_supported ( ) ) {
105- var tty = require ( "node:tty" ) ;
106- return tty . isatty ( caml_unix_lookup_file ( fd ) . fd ) ? 1 : 0 ;
107- } else {
108- return 0 ;
109- }
104+ var file = caml_unix_lookup_file ( fd ) ;
105+ if ( ! file . isatty ) return 0 ;
106+ return file . isatty ( ) ;
110107}
111108
112109//Provides: caml_unix_isatty
You can’t perform that action at this time.
0 commit comments