mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
Updates for the review comments
This commit is contained in:
@@ -7,6 +7,8 @@ use std::{collections::BTreeSet, path::Path};
|
||||
use wasmer::{AsStoreMut, Instance, Module, RuntimeError, Value};
|
||||
use wasmer_vfs::FileSystem;
|
||||
use wasmer_vfs::{DeviceFile, PassthruFileSystem, RootFileSystemBuilder};
|
||||
use wasmer_wasi::os::tty_sys::SysTyy;
|
||||
use wasmer_wasi::os::TtyBridge;
|
||||
use wasmer_wasi::types::__WASI_STDIN_FILENO;
|
||||
use wasmer_wasi::{
|
||||
default_fs_backing, get_wasi_versions, PluggableRuntimeImplementation, WasiEnv, WasiError,
|
||||
@@ -60,6 +62,10 @@ pub struct Wasi {
|
||||
#[clap(long = "net")]
|
||||
pub networking: bool,
|
||||
|
||||
/// Disables the TTY bridge
|
||||
#[clap(long = "no-tty")]
|
||||
pub no_tty: bool,
|
||||
|
||||
/// Allow instances to send http requests.
|
||||
///
|
||||
/// Access to domains is granted by default.
|
||||
@@ -128,6 +134,12 @@ impl Wasi {
|
||||
rt.set_networking_implementation(wasmer_vnet::UnsupportedVirtualNetworking::default());
|
||||
}
|
||||
|
||||
if self.no_tty == false {
|
||||
let tty = Arc::new(SysTyy::default());
|
||||
tty.reset();
|
||||
rt.set_tty(tty)
|
||||
}
|
||||
|
||||
let engine = store.as_store_mut().engine().clone();
|
||||
rt.set_engine(Some(engine));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user