Class
PromptContext
ConsoleMonster.Prompts
A snapshot shared by all shell prompt segments in one evaluation.
Inheritance
- object
- PromptContext
Usage
Explore 5 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Property ShellPrompt.Context
Accepted by parameters 4
- Method IPromptSegment.Evaluate
- Method PromptEngine.Refresh
- Extension method ShellPrompt.Context
- Method ShellPromptFluent.Context
Constructors
public PromptContext(string path, TerminalProfile terminal, ITheme theme, DateTimeOffset now, string? providerPath = null, string provider = "FileSystem", string? home = null, bool succeeded = true, int? exitCode = null, string? errorCategory = null, string? errorType = null, string? errorTarget = null, TimeSpan duration = default, long historyId = 0, string? user = null, string? host = null, bool elevated = false, bool ssh = false, int nesting = 0, bool debugging = false, int jobs = 0, string? edition = null, Version? version = null, IReadOnlyDictionary<string, string>? environment = null, string? loginUser = null, bool? isGitWorkTree = null) #Creates a snapshot. All properties are fixed for the duration of a prompt evaluation.
Parameters
- path string
- terminal ConsoleMonster.Capabilities.TerminalProfile
- theme ConsoleMonster.Styling.ITheme
- now System.DateTimeOffset
- providerPath string? = null
- provider string = "FileSystem"
- home string? = null
- succeeded bool = true
- exitCode int? = null
- errorCategory string? = null
- errorType string? = null
- errorTarget string? = null
- duration System.TimeSpan = default
- historyId long = 0
- user string? = null
- host string? = null
- elevated bool = false
- ssh bool = false
- nesting int = 0
- debugging bool = false
- jobs int = 0
- edition string? = null
- version System.Version? = null
- environment System.Collections.Generic.IReadOnlyDictionary<string, string>? = null
- loginUser string? = null
- isGitWorkTree bool? = null
Inherited Methods
Properties
public bool IsFileSystem { get; } #Whether the current path belongs to the filesystem provider.
public bool? IsGitWorkTree { get; } #The latest recorded Git worktree result, or null until the provider has observed the location.
public int? ExitCode { get; } #The last command's native exit code, if it was native.
public TerminalProfile Terminal { get; } #The terminal settings and capabilities.
public DateTimeOffset Now { get; } #The evaluation time, shared by all segments.
public IReadOnlyDictionary<string, string> Environment { get; } #The environment variables made available to segments by the host.