CmdShell class

Windows Power Shell

Mixed in types

Constructors

CmdShell.withPid(int? pid)
Attached to a command shell with the given

Properties

canModifyPath bool
Returns true if this shell supports modifying the shell's PATH
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
hasStartScript bool
True if this shell supports a start script or configuration file. e.g. a script that is run by the shell or a configuration file that is read when the shell starts.
no setteroverride
installInstructions String
Returns the instructions to install DCli.
no setterinherited
isCompletionInstalled bool
no setteroverride
isCompletionSupported bool
no setteroverride
isPrivilegedPasswordRequired bool
Returns true if running a privileged action woulduser cause a password to be requested.
no setterinherited
isPrivilegedProcess bool
Returns true if the current process is running with elevated privileges e.g. Is running as an Administrator.
no setterinherited
isPrivilegedUser bool
Returns true if the current process is running with elevated privileges e.g. Is running as an Administrator.
no setterinherited
isSudo bool
On Windows this is always false.
no setterinherited
loggedInUser String?
no setterinherited
loggedInUsersHome String
Attempts to retrive the logged in user's home directory.
no setterinherited
name String
The name of the shell e.g. bash
no setteroverride
pathToStartScript String
Returns the path to the shell's start script or config file e.g /home/
no setteroverride
pid int?
The pid of the current shell
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startScriptName String
Returns the name of the shell's startup script or configuration file e.g. .bashrc
no setteroverride

Methods

addFileAssocation(String dcliPath) → void
Called during the install so that an OS that needs to create a file association between .dart and dcli can create that association. The implementor is responsible for not adding the association if it already exists.
override
addFileAssociation(String dcliPath) → void
Add a file association so that typing the name of a dart script on the cli launches dcli which in turn launches the script.
inherited
addFileAssociationv2() → void
Add a file association so that typing the name of a dart script on the cli launches dcli which in turn launches the script.
inherited
addToPATH(String path) bool
Adds a path to the start script returns true if adding the path was successful
override
appendToPATH(String path) bool
Appends path to the end of the PATH by updating the Windows Registry. We update the user's PATH (HKEY_CURRENT_USER) rather than the system path so this change will only affect the logged in user.
inherited
checkInstallPreconditions() String?
Check if the shell has any notes re: pre-isntallation conditions.
inherited
inDeveloperMode() bool
Windows 10+ has a developer mode that needs to be enabled to create symlinks without escalated prividedges. For details on enabling dev mode on windows see: https://dcli.onepub.dev/getting-started/installing-on-windows
inherited
install({bool installDart = true, bool activate = true}) bool
Called to install the windows specific dart/dcli components.
inherited
installTabCompletion({bool quiet = false}) → void
If the shell supports tab completion then install it. If quiet is true then suppress any console output except for errors.
override
matchByName(String name) bool
Returns true if the shells name matches the passed name. The comparison is case insensitive.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prependToPATH(String path) bool
Prepend path to the end of the PATH by updating the Windows Registry. We update the user's PATH (HKEY_CURRENT_USER) rather than the system path so this change will only affect the logged in user.
inherited
privilegesRequiredMessage(String app) String
inherited
releasePrivileges() → void
NO OP under windows
inherited
restorePrivileges() → void
NO OP under windows
inherited
toString() String
A string representation of this object.
inherited
withPrivileges(RunPrivileged action, {bool allowUnprivileged = false}) → void
Run action with root UID and gid
inherited

Operators

operator ==(covariant CmdShell other) bool
The equality operator.
override

Constants

shellName → const String
Name of the shell