File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 CARGO_TARGET_WASM32_WASIP1_RUNNER : wasmtime
3838 run : |
3939 # Get all utilities and exclude ones that don't compile for wasm32-wasip1
40- EXCLUDE="dd|df|du|env|expr|mktemp|more|tac|test|tty "
40+ EXCLUDE="dd|df|du|env|expr|mktemp|more|tac|test"
4141 UTILS=$(./util/show-utils.sh | tr ' ' '\n' | grep -vE "^($EXCLUDE)$" | sed 's/^/-p uu_/' | tr '\n' ' ')
4242 cargo test --target wasm32-wasip1 --no-default-features $UTILS
4343 - name : Run integration tests via wasmtime
Original file line number Diff line number Diff line change @@ -235,6 +235,7 @@ feat_wasm = [
235235 " true" ,
236236 " truncate" ,
237237 " tsort" ,
238+ " tty" ,
238239 " uname" ,
239240 " unexpand" ,
240241 " uniq" ,
Original file line number Diff line number Diff line change @@ -49,7 +49,14 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
4949 set_exit_code ( 1 ) ;
5050 writeln ! ( stdout, "{}" , translate!( "tty-not-a-tty" ) )
5151 } ;
52-
52+ #[ cfg( target_os = "wasi" ) ]
53+ let write_result = if std:: io:: stdin ( ) . is_terminal ( ) {
54+ // maximize compatibility
55+ writeln ! ( stdout, r"/dev/tty" )
56+ } else {
57+ set_exit_code ( 1 ) ;
58+ writeln ! ( stdout, "{}" , translate!( "tty-not-a-tty" ) )
59+ } ;
5360 #[ cfg( target_os = "windows" ) ]
5461 let write_result = if std:: io:: stdin ( ) . is_terminal ( ) {
5562 writeln ! ( stdout, r"\\.\CON" )
You can’t perform that action at this time.
0 commit comments