pub struct PowerShell<'os> { /* private fields */ }Expand description
The PowerShell shell.
Implementations§
Source§impl<'os> PowerShell<'os>
impl<'os> PowerShell<'os>
Sourcepub fn new(
os: &'os Windows,
actor: ActorId,
environment: Environment,
) -> Result<Self, OsError>
pub fn new( os: &'os Windows, actor: ActorId, environment: Environment, ) -> Result<Self, OsError>
Creates a PowerShell shell for a session.
Sessions start in the user’s profile directory (or the filesystem root if the profile is not materialized).
Sourcepub fn environment(&self) -> &Environment
pub fn environment(&self) -> &Environment
The base environment.
Trait Implementations§
Source§impl<'os> Shell for PowerShell<'os>
impl<'os> Shell for PowerShell<'os>
Source§fn actor(&self) -> ActorId
fn actor(&self) -> ActorId
The acting identity (used for filesystem lookups, for example tab
completion).
Source§fn environment(&self) -> &Environment
fn environment(&self) -> &Environment
The shell environment (variables,
PATH, HOME, …).Source§fn cwd(&self) -> &VirtualPath
fn cwd(&self) -> &VirtualPath
The current working directory.
The banner printed before the first prompt, or
None when the
shell prints none. Unix shells print the Last login line; the
Windows shells print their startup banners.Source§fn prompt(&self, hostname: &str) -> String
fn prompt(&self, hostname: &str) -> String
The prompt string, ending with a trailing space. Read more
Source§fn set_terminal_size(&mut self, rows: u16, cols: u16)
fn set_terminal_size(&mut self, rows: u16, cols: u16)
Reports the terminal size, exported as
COLUMNS/LINES so commands
(for example ls) lay out against the live console width. Read moreSource§fn execute(
&mut self,
line: &str,
stdin: &mut dyn Input,
stdout: &mut dyn Output,
stderr: &mut dyn Output,
) -> ExitStatus
fn execute( &mut self, line: &str, stdin: &mut dyn Input, stdout: &mut dyn Output, stderr: &mut dyn Output, ) -> ExitStatus
Executes a line of shell input.
Source§fn execute_with_terminal(
&mut self,
line: &str,
stdin: &mut dyn Input,
stdout: &mut dyn Output,
stderr: &mut dyn Output,
_terminal: Option<&mut dyn Terminal>,
) -> ExitStatus
fn execute_with_terminal( &mut self, line: &str, stdin: &mut dyn Input, stdout: &mut dyn Output, stderr: &mut dyn Output, _terminal: Option<&mut dyn Terminal>, ) -> ExitStatus
Executes a line with an optional terminal.
Source§fn take_exit_status(&mut self) -> Option<ExitStatus>
fn take_exit_status(&mut self) -> Option<ExitStatus>
Takes a pending session-exit request (
exit [N]), if any. Read moreSource§fn history(&self) -> &[String]
fn history(&self) -> &[String]
The command history: exactly the lines the interactive application
recorded through
Shell::record_history.Source§fn record_history(&mut self, line: &str)
fn record_history(&mut self, line: &str)
Records one completed command line. Read more
Source§fn needs_continuation(&self, input: &str) -> bool
fn needs_continuation(&self, input: &str) -> bool
Whether the input is an incomplete construct that needs more lines
(for example a here-document or an unclosed
if).Auto Trait Implementations§
impl<'os> !RefUnwindSafe for PowerShell<'os>
impl<'os> !UnwindSafe for PowerShell<'os>
impl<'os> Freeze for PowerShell<'os>
impl<'os> Send for PowerShell<'os>
impl<'os> Sync for PowerShell<'os>
impl<'os> Unpin for PowerShell<'os>
impl<'os> UnsafeUnpin for PowerShell<'os>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more